'<(skia_src_path)/gpu/GrBlurUtils.h',
'<(skia_src_path)/gpu/GrBufferAllocPool.cpp',
'<(skia_src_path)/gpu/GrBufferAllocPool.h',
+ '<(skia_src_path)/gpu/GrBufferedDrawTarget.cpp',
+ '<(skia_src_path)/gpu/GrBufferedDrawTarget.h',
'<(skia_src_path)/gpu/GrCaps.cpp',
'<(skia_src_path)/gpu/GrClip.cpp',
'<(skia_src_path)/gpu/GrClipMaskCache.h',
'<(skia_src_path)/gpu/GrInvariantOutput.cpp',
'<(skia_src_path)/gpu/GrInOrderCommandBuilder.cpp',
'<(skia_src_path)/gpu/GrInOrderCommandBuilder.h',
- '<(skia_src_path)/gpu/GrInOrderDrawBuffer.cpp',
- '<(skia_src_path)/gpu/GrInOrderDrawBuffer.h',
'<(skia_src_path)/gpu/GrLayerCache.cpp',
'<(skia_src_path)/gpu/GrLayerCache.h',
'<(skia_src_path)/gpu/GrLayerHoister.cpp',
#include "SkView.h"
/**
- * Animated sample used to develop batched rect implementation in GrInOrderDrawBuffer.
+ * Animated sample used to develop batched rect implementation in GrBufferedDrawTarget.
*/
class ManyRectsView : public SampleView {
private:
* found in the LICENSE file.
*/
-#include "GrInOrderDrawBuffer.h"
+#include "GrBufferedDrawTarget.h"
// We will use the reordering buffer, unless we have NVPR.
// TODO move NVPR to batch so we can reorder
return caps && caps->shaderCaps() && !caps->shaderCaps()->pathRenderingSupport();
}
-GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context)
+GrBufferedDrawTarget::GrBufferedDrawTarget(GrContext* context)
: INHERITED(context)
, fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(context->caps())))
, fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4)
, fDrawID(0) {
}
-GrInOrderDrawBuffer::~GrInOrderDrawBuffer() {
+GrBufferedDrawTarget::~GrBufferedDrawTarget() {
this->reset();
}
-void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch,
- const PipelineInfo& pipelineInfo) {
+void GrBufferedDrawTarget::onDrawBatch(GrBatch* batch,
+ const PipelineInfo& pipelineInfo) {
State* state = this->setupPipelineAndShouldDraw(batch, pipelineInfo);
if (!state) {
return;
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::onStencilPath(const GrPipelineBuilder& pipelineBuilder,
- const GrPathProcessor* pathProc,
- const GrPath* path,
- const GrScissorState& scissorState,
- const GrStencilSettings& stencilSettings) {
+void GrBufferedDrawTarget::onStencilPath(const GrPipelineBuilder& pipelineBuilder,
+ const GrPathProcessor* pathProc,
+ const GrPath* path,
+ const GrScissorState& scissorState,
+ const GrStencilSettings& stencilSettings) {
GrTargetCommands::Cmd* cmd = fCommands->recordStencilPath(pipelineBuilder,
pathProc, path, scissorState,
stencilSettings);
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::onDrawPath(const GrPathProcessor* pathProc,
- const GrPath* path,
- const GrStencilSettings& stencilSettings,
- const PipelineInfo& pipelineInfo) {
+void GrBufferedDrawTarget::onDrawPath(const GrPathProcessor* pathProc,
+ const GrPath* path,
+ const GrStencilSettings& stencilSettings,
+ const PipelineInfo& pipelineInfo) {
State* state = this->setupPipelineAndShouldDraw(pathProc, pipelineInfo);
if (!state) {
return;
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::onDrawPaths(const GrPathProcessor* pathProc,
- const GrPathRange* pathRange,
- const void* indices,
- PathIndexType indexType,
- const float transformValues[],
- PathTransformType transformType,
- int count,
- const GrStencilSettings& stencilSettings,
- const PipelineInfo& pipelineInfo) {
+void GrBufferedDrawTarget::onDrawPaths(const GrPathProcessor* pathProc,
+ const GrPathRange* pathRange,
+ const void* indices,
+ PathIndexType indexType,
+ const float transformValues[],
+ PathTransformType transformType,
+ int count,
+ const GrStencilSettings& stencilSettings,
+ const PipelineInfo& pipelineInfo) {
State* state = this->setupPipelineAndShouldDraw(pathProc, pipelineInfo);
if (!state) {
return;
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::onClear(const SkIRect* rect, GrColor color,
+void GrBufferedDrawTarget::onClear(const SkIRect* rect, GrColor color,
bool canIgnoreRect, GrRenderTarget* renderTarget) {
GrTargetCommands::Cmd* cmd = fCommands->recordClear(rect, color, canIgnoreRect, renderTarget);
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::clearStencilClip(const SkIRect& rect,
- bool insideClip,
- GrRenderTarget* renderTarget) {
+void GrBufferedDrawTarget::clearStencilClip(const SkIRect& rect,
+ bool insideClip,
+ GrRenderTarget* renderTarget) {
GrTargetCommands::Cmd* cmd = fCommands->recordClearStencilClip(rect, insideClip, renderTarget);
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) {
+void GrBufferedDrawTarget::discard(GrRenderTarget* renderTarget) {
if (!this->caps()->discardRenderTargetSupport()) {
return;
}
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::onReset() {
+void GrBufferedDrawTarget::onReset() {
fCommands->reset();
fPathIndexBuffer.rewind();
fPathTransformBuffer.rewind();
}
}
-void GrInOrderDrawBuffer::onFlush() {
+void GrBufferedDrawTarget::onFlush() {
fCommands->flush(this);
++fDrawID;
}
-void GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
- GrSurface* src,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint) {
+void GrBufferedDrawTarget::onCopySurface(GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint) {
GrTargetCommands::Cmd* cmd = fCommands->recordCopySurface(dst, src, srcRect, dstPoint);
this->recordTraceMarkersIfNecessary(cmd);
}
-void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* cmd) {
+void GrBufferedDrawTarget::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* cmd) {
if (!cmd) {
return;
}
}
GrTargetCommands::State*
-GrInOrderDrawBuffer::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* primProc,
- const GrDrawTarget::PipelineInfo& pipelineInfo) {
+GrBufferedDrawTarget::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* primProc,
+ const GrDrawTarget::PipelineInfo& pipelineInfo) {
State* state = this->allocState(primProc);
this->setupPipeline(pipelineInfo, state->pipelineLocation());
}
GrTargetCommands::State*
-GrInOrderDrawBuffer::setupPipelineAndShouldDraw(GrBatch* batch,
- const GrDrawTarget::PipelineInfo& pipelineInfo) {
+GrBufferedDrawTarget::setupPipelineAndShouldDraw(GrBatch* batch,
+ const GrDrawTarget::PipelineInfo& pipelineInfo) {
State* state = this->allocState();
this->setupPipeline(pipelineInfo, state->pipelineLocation());
* found in the LICENSE file.
*/
-#ifndef GrInOrderDrawBuffer_DEFINED
-#define GrInOrderDrawBuffer_DEFINED
+#ifndef GrBufferedDrawTarget_DEFINED
+#define GrBufferedDrawTarget_DEFINED
#include "GrDrawTarget.h"
#include "GrCommandBuilder.h"
#include "SkChunkAlloc.h"
/**
- * GrInOrderDrawBuffer is an implementation of GrDrawTarget that queues up draws for eventual
- * playback into a GrGpu. In theory one draw buffer could playback into another. When index or
- * vertex buffers are used as geometry sources it is the callers the draw buffer only holds
- * references to the buffers. It is the callers responsibility to ensure that the data is still
- * valid when the draw buffer is played back into a GrGpu. Similarly, it is the caller's
- * responsibility to ensure that all referenced textures, buffers, and render-targets are associated
- * in the GrGpu object that the buffer is played back into. The buffer requires VB and IB pools to
- * store geometry.
+ * GrBufferedDrawTarget is an implementation of GrDrawTarget that queues up draws for eventual
+ * playback into a GrGpu. In theory one draw buffer could playback into another. Similarly, it is
+ * the caller's responsibility to ensure that all referenced textures, buffers, and render-targets
+ * are associated in the GrGpu object that the buffer is played back into.
*/
-class GrInOrderDrawBuffer : public GrClipTarget {
+class GrBufferedDrawTarget : public GrClipTarget {
public:
/**
- * Creates a GrInOrderDrawBuffer
+ * Creates a GrBufferedDrawTarget
*
* @param context the context object that owns this draw buffer.
*/
- GrInOrderDrawBuffer(GrContext* context);
+ GrBufferedDrawTarget(GrContext* context);
- ~GrInOrderDrawBuffer() override;
+ ~GrBufferedDrawTarget() override;
void clearStencilClip(const SkIRect& rect,
bool insideClip,
// Either a hard (stencil buffer) clip was explicitly requested or an anti-aliased clip couldn't
// be created. In either case, free up the texture in the anti-aliased mask cache.
// TODO: this may require more investigation. Ganesh performs a lot of utility draws (e.g.,
- // clears, InOrderDrawBuffer playbacks) that hit the stencil buffer path. These may be
+ // clears, GrBufferedDrawTarget playbacks) that hit the stencil buffer path. These may be
// "incorrectly" clearing the AA cache.
fAACache.reset();
#include "GrTargetCommands.h"
-class GrInOrderDrawBuffer;
+class GrBufferedDrawTarget;
class GrCommandBuilder : ::SkNoncopyable {
public:
virtual ~GrCommandBuilder() {}
void reset() { fCommands.reset(); }
- void flush(GrInOrderDrawBuffer* iodb) { fCommands.flush(iodb); }
+ void flush(GrBufferedDrawTarget* bufferedDrawTarget) { fCommands.flush(bufferedDrawTarget); }
virtual Cmd* recordClearStencilClip(const SkIRect& rect,
bool insideClip,
const GrPath*,
const GrStencilSettings&) = 0;
virtual Cmd* recordDrawPaths(State*,
- GrInOrderDrawBuffer*,
+ GrBufferedDrawTarget*,
const GrPathProcessor*,
const GrPathRange*,
const void*,
#include "GrBatchFontCache.h"
#include "GrBatchTarget.h"
#include "GrBatchTest.h"
+#include "GrBufferedDrawTarget.h"
#include "GrCaps.h"
#include "GrContextOptions.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrGpu.h"
#include "GrImmediateDrawTarget.h"
#include "GrIndexBuffer.h"
-#include "GrInOrderDrawBuffer.h"
#include "GrLayerCache.h"
#include "GrOvalRenderer.h"
#include "GrPathRenderer.h"
#ifdef IMMEDIATE_MODE
fDrawTarget = SkNEW_ARGS(GrImmediateDrawTarget, (context));
#else
- fDrawTarget = SkNEW_ARGS(GrInOrderDrawBuffer, (context));
+ fDrawTarget = SkNEW_ARGS(GrBufferedDrawTarget, (context));
#endif
}
GrContext* context = reinterpret_cast<GrContext*>(data);
- // Flush the InOrderDrawBuffer to possibly free up some textures
+ // Flush the GrBufferedDrawTarget to possibly free up some textures
context->fFlushToReduceCacheSize = true;
}
#include "GrInOrderCommandBuilder.h"
+#include "GrBufferedDrawTarget.h"
+
#include "GrColor.h"
-#include "GrInOrderDrawBuffer.h"
#include "SkPoint.h"
static bool path_fill_type_is_winding(const GrStencilSettings& pathStencilSettings) {
GrTargetCommands::Cmd*
GrInOrderCommandBuilder::recordDrawPaths(State* state,
- GrInOrderDrawBuffer* iodb,
+ GrBufferedDrawTarget* bufferedDrawTarget,
const GrPathProcessor* pathProc,
const GrPathRange* pathRange,
const void* indexValues,
char* savedIndices;
float* savedTransforms;
- iodb->appendIndicesAndTransforms(indexValues, indexType,
- transformValues, transformType,
- count, &savedIndices, &savedTransforms);
+ bufferedDrawTarget->appendIndicesAndTransforms(indexValues, indexType,
+ transformValues, transformType,
+ count, &savedIndices, &savedTransforms);
if (!this->cmdBuffer()->empty() &&
Cmd::kDrawPaths_CmdType == this->cmdBuffer()->back().type()) {
const GrPath*,
const GrStencilSettings&) override;
Cmd* recordDrawPaths(State*,
- GrInOrderDrawBuffer*,
+ GrBufferedDrawTarget*,
const GrPathProcessor*,
const GrPathRange*,
const void*,
}
Cmd* recordDrawPaths(State*,
- GrInOrderDrawBuffer*,
+ GrBufferedDrawTarget*,
const GrPathProcessor*,
const GrPathRange*,
const void*,
#include "GrTargetCommands.h"
-#include "GrInOrderDrawBuffer.h"
+#include "GrBufferedDrawTarget.h"
void GrTargetCommands::reset() {
fCmdBuffer.reset();
fBatchTarget.reset();
}
-void GrTargetCommands::flush(GrInOrderDrawBuffer* iodb) {
+void GrTargetCommands::flush(GrBufferedDrawTarget* bufferedDrawTarget) {
if (fCmdBuffer.empty()) {
return;
}
- GrGpu* gpu = iodb->getGpu();
+ GrGpu* gpu = bufferedDrawTarget->getGpu();
// Loop over all batches and generate geometry
CmdBuffer::Iter genIter(fCmdBuffer);
GrGpuTraceMarker newMarker("", -1);
SkString traceString;
if (iter->isTraced()) {
- traceString = iodb->getCmdString(iter->markerID());
+ traceString = bufferedDrawTarget->getCmdString(iter->markerID());
newMarker.fMarker = traceString.c_str();
gpu->addGpuTraceMarker(&newMarker);
}
#include "SkRect.h"
#include "SkTypes.h"
-class GrInOrderDrawBuffer;
+class GrBufferedDrawTarget;
class GrTargetCommands : ::SkNoncopyable {
};
void reset();
- void flush(GrInOrderDrawBuffer*);
+ void flush(GrBufferedDrawTarget*);
private:
friend class GrCommandBuilder;
- friend class GrInOrderDrawBuffer; // This goes away when State becomes just a pipeline
+ friend class GrBufferedDrawTarget; // This goes away when State becomes just a pipeline
friend class GrReorderCommandBuilder;
typedef GrGpu::DrawArgs DrawArgs;
- void recordXferBarrierIfNecessary(const GrPipeline&, GrInOrderDrawBuffer*);
+ void recordXferBarrierIfNecessary(const GrPipeline&, GrBufferedDrawTarget*);
// TODO: This can be just a pipeline once paths are in batch, and it should live elsewhere
struct State : public SkNVRefCnt<State> {
*/
#include "GrTest.h"
+
+#include "GrBufferedDrawTarget.h"
#include "GrContextOptions.h"
#include "GrGpuResourceCacheAccess.h"
-#include "GrInOrderDrawBuffer.h"
#include "GrResourceCache.h"
#include "SkString.h"
// Code for the mock context. It's built on a mock GrGpu class that does nothing.
////
-#include "GrInOrderDrawBuffer.h"
#include "GrGpu.h"
class GrPipeline;
#ifndef GrTracing_DEFINED
#define GrTracing_DEFINED
+#include "GrBufferedDrawTarget.h"
#include "GrDrawTarget.h"
#include "GrGpu.h"
-#include "GrInOrderDrawBuffer.h"
#include "GrTraceMarker.h"
#include "SkTraceEvent.h"