Rename GrInOrderDrawBuffer to GrBufferedDrawTarget
BUG=skia: Review URL: https://codereview.chromium.org/1261033002
This commit is contained in:
parent
fd8ed69447
commit
b542bae1f5
@ -90,6 +90,8 @@
|
|||||||
'<(skia_src_path)/gpu/GrBlurUtils.h',
|
'<(skia_src_path)/gpu/GrBlurUtils.h',
|
||||||
'<(skia_src_path)/gpu/GrBufferAllocPool.cpp',
|
'<(skia_src_path)/gpu/GrBufferAllocPool.cpp',
|
||||||
'<(skia_src_path)/gpu/GrBufferAllocPool.h',
|
'<(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/GrCaps.cpp',
|
||||||
'<(skia_src_path)/gpu/GrClip.cpp',
|
'<(skia_src_path)/gpu/GrClip.cpp',
|
||||||
'<(skia_src_path)/gpu/GrClipMaskCache.h',
|
'<(skia_src_path)/gpu/GrClipMaskCache.h',
|
||||||
@ -128,8 +130,6 @@
|
|||||||
'<(skia_src_path)/gpu/GrInvariantOutput.cpp',
|
'<(skia_src_path)/gpu/GrInvariantOutput.cpp',
|
||||||
'<(skia_src_path)/gpu/GrInOrderCommandBuilder.cpp',
|
'<(skia_src_path)/gpu/GrInOrderCommandBuilder.cpp',
|
||||||
'<(skia_src_path)/gpu/GrInOrderCommandBuilder.h',
|
'<(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.cpp',
|
||||||
'<(skia_src_path)/gpu/GrLayerCache.h',
|
'<(skia_src_path)/gpu/GrLayerCache.h',
|
||||||
'<(skia_src_path)/gpu/GrLayerHoister.cpp',
|
'<(skia_src_path)/gpu/GrLayerHoister.cpp',
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "SkView.h"
|
#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 {
|
class ManyRectsView : public SampleView {
|
||||||
private:
|
private:
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* found in the LICENSE file.
|
* found in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GrInOrderDrawBuffer.h"
|
#include "GrBufferedDrawTarget.h"
|
||||||
|
|
||||||
// We will use the reordering buffer, unless we have NVPR.
|
// We will use the reordering buffer, unless we have NVPR.
|
||||||
// TODO move NVPR to batch so we can reorder
|
// TODO move NVPR to batch so we can reorder
|
||||||
@ -13,7 +13,7 @@ static inline bool allow_reordering(const GrCaps* caps) {
|
|||||||
return caps && caps->shaderCaps() && !caps->shaderCaps()->pathRenderingSupport();
|
return caps && caps->shaderCaps() && !caps->shaderCaps()->pathRenderingSupport();
|
||||||
}
|
}
|
||||||
|
|
||||||
GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context)
|
GrBufferedDrawTarget::GrBufferedDrawTarget(GrContext* context)
|
||||||
: INHERITED(context)
|
: INHERITED(context)
|
||||||
, fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(context->caps())))
|
, fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(context->caps())))
|
||||||
, fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4)
|
, fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4)
|
||||||
@ -22,12 +22,12 @@ GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context)
|
|||||||
, fDrawID(0) {
|
, fDrawID(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
GrInOrderDrawBuffer::~GrInOrderDrawBuffer() {
|
GrBufferedDrawTarget::~GrBufferedDrawTarget() {
|
||||||
this->reset();
|
this->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch,
|
void GrBufferedDrawTarget::onDrawBatch(GrBatch* batch,
|
||||||
const PipelineInfo& pipelineInfo) {
|
const PipelineInfo& pipelineInfo) {
|
||||||
State* state = this->setupPipelineAndShouldDraw(batch, pipelineInfo);
|
State* state = this->setupPipelineAndShouldDraw(batch, pipelineInfo);
|
||||||
if (!state) {
|
if (!state) {
|
||||||
return;
|
return;
|
||||||
@ -37,21 +37,21 @@ void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch,
|
|||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onStencilPath(const GrPipelineBuilder& pipelineBuilder,
|
void GrBufferedDrawTarget::onStencilPath(const GrPipelineBuilder& pipelineBuilder,
|
||||||
const GrPathProcessor* pathProc,
|
const GrPathProcessor* pathProc,
|
||||||
const GrPath* path,
|
const GrPath* path,
|
||||||
const GrScissorState& scissorState,
|
const GrScissorState& scissorState,
|
||||||
const GrStencilSettings& stencilSettings) {
|
const GrStencilSettings& stencilSettings) {
|
||||||
GrTargetCommands::Cmd* cmd = fCommands->recordStencilPath(pipelineBuilder,
|
GrTargetCommands::Cmd* cmd = fCommands->recordStencilPath(pipelineBuilder,
|
||||||
pathProc, path, scissorState,
|
pathProc, path, scissorState,
|
||||||
stencilSettings);
|
stencilSettings);
|
||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onDrawPath(const GrPathProcessor* pathProc,
|
void GrBufferedDrawTarget::onDrawPath(const GrPathProcessor* pathProc,
|
||||||
const GrPath* path,
|
const GrPath* path,
|
||||||
const GrStencilSettings& stencilSettings,
|
const GrStencilSettings& stencilSettings,
|
||||||
const PipelineInfo& pipelineInfo) {
|
const PipelineInfo& pipelineInfo) {
|
||||||
State* state = this->setupPipelineAndShouldDraw(pathProc, pipelineInfo);
|
State* state = this->setupPipelineAndShouldDraw(pathProc, pipelineInfo);
|
||||||
if (!state) {
|
if (!state) {
|
||||||
return;
|
return;
|
||||||
@ -60,15 +60,15 @@ void GrInOrderDrawBuffer::onDrawPath(const GrPathProcessor* pathProc,
|
|||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onDrawPaths(const GrPathProcessor* pathProc,
|
void GrBufferedDrawTarget::onDrawPaths(const GrPathProcessor* pathProc,
|
||||||
const GrPathRange* pathRange,
|
const GrPathRange* pathRange,
|
||||||
const void* indices,
|
const void* indices,
|
||||||
PathIndexType indexType,
|
PathIndexType indexType,
|
||||||
const float transformValues[],
|
const float transformValues[],
|
||||||
PathTransformType transformType,
|
PathTransformType transformType,
|
||||||
int count,
|
int count,
|
||||||
const GrStencilSettings& stencilSettings,
|
const GrStencilSettings& stencilSettings,
|
||||||
const PipelineInfo& pipelineInfo) {
|
const PipelineInfo& pipelineInfo) {
|
||||||
State* state = this->setupPipelineAndShouldDraw(pathProc, pipelineInfo);
|
State* state = this->setupPipelineAndShouldDraw(pathProc, pipelineInfo);
|
||||||
if (!state) {
|
if (!state) {
|
||||||
return;
|
return;
|
||||||
@ -80,20 +80,20 @@ void GrInOrderDrawBuffer::onDrawPaths(const GrPathProcessor* pathProc,
|
|||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onClear(const SkIRect* rect, GrColor color,
|
void GrBufferedDrawTarget::onClear(const SkIRect* rect, GrColor color,
|
||||||
bool canIgnoreRect, GrRenderTarget* renderTarget) {
|
bool canIgnoreRect, GrRenderTarget* renderTarget) {
|
||||||
GrTargetCommands::Cmd* cmd = fCommands->recordClear(rect, color, canIgnoreRect, renderTarget);
|
GrTargetCommands::Cmd* cmd = fCommands->recordClear(rect, color, canIgnoreRect, renderTarget);
|
||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::clearStencilClip(const SkIRect& rect,
|
void GrBufferedDrawTarget::clearStencilClip(const SkIRect& rect,
|
||||||
bool insideClip,
|
bool insideClip,
|
||||||
GrRenderTarget* renderTarget) {
|
GrRenderTarget* renderTarget) {
|
||||||
GrTargetCommands::Cmd* cmd = fCommands->recordClearStencilClip(rect, insideClip, renderTarget);
|
GrTargetCommands::Cmd* cmd = fCommands->recordClearStencilClip(rect, insideClip, renderTarget);
|
||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) {
|
void GrBufferedDrawTarget::discard(GrRenderTarget* renderTarget) {
|
||||||
if (!this->caps()->discardRenderTargetSupport()) {
|
if (!this->caps()->discardRenderTargetSupport()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) {
|
|||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onReset() {
|
void GrBufferedDrawTarget::onReset() {
|
||||||
fCommands->reset();
|
fCommands->reset();
|
||||||
fPathIndexBuffer.rewind();
|
fPathIndexBuffer.rewind();
|
||||||
fPathTransformBuffer.rewind();
|
fPathTransformBuffer.rewind();
|
||||||
@ -118,20 +118,20 @@ void GrInOrderDrawBuffer::onReset() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onFlush() {
|
void GrBufferedDrawTarget::onFlush() {
|
||||||
fCommands->flush(this);
|
fCommands->flush(this);
|
||||||
++fDrawID;
|
++fDrawID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
|
void GrBufferedDrawTarget::onCopySurface(GrSurface* dst,
|
||||||
GrSurface* src,
|
GrSurface* src,
|
||||||
const SkIRect& srcRect,
|
const SkIRect& srcRect,
|
||||||
const SkIPoint& dstPoint) {
|
const SkIPoint& dstPoint) {
|
||||||
GrTargetCommands::Cmd* cmd = fCommands->recordCopySurface(dst, src, srcRect, dstPoint);
|
GrTargetCommands::Cmd* cmd = fCommands->recordCopySurface(dst, src, srcRect, dstPoint);
|
||||||
this->recordTraceMarkersIfNecessary(cmd);
|
this->recordTraceMarkersIfNecessary(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* cmd) {
|
void GrBufferedDrawTarget::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* cmd) {
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -147,8 +147,8 @@ void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* c
|
|||||||
}
|
}
|
||||||
|
|
||||||
GrTargetCommands::State*
|
GrTargetCommands::State*
|
||||||
GrInOrderDrawBuffer::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* primProc,
|
GrBufferedDrawTarget::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* primProc,
|
||||||
const GrDrawTarget::PipelineInfo& pipelineInfo) {
|
const GrDrawTarget::PipelineInfo& pipelineInfo) {
|
||||||
State* state = this->allocState(primProc);
|
State* state = this->allocState(primProc);
|
||||||
this->setupPipeline(pipelineInfo, state->pipelineLocation());
|
this->setupPipeline(pipelineInfo, state->pipelineLocation());
|
||||||
|
|
||||||
@ -176,8 +176,8 @@ GrInOrderDrawBuffer::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* prim
|
|||||||
}
|
}
|
||||||
|
|
||||||
GrTargetCommands::State*
|
GrTargetCommands::State*
|
||||||
GrInOrderDrawBuffer::setupPipelineAndShouldDraw(GrBatch* batch,
|
GrBufferedDrawTarget::setupPipelineAndShouldDraw(GrBatch* batch,
|
||||||
const GrDrawTarget::PipelineInfo& pipelineInfo) {
|
const GrDrawTarget::PipelineInfo& pipelineInfo) {
|
||||||
State* state = this->allocState();
|
State* state = this->allocState();
|
||||||
this->setupPipeline(pipelineInfo, state->pipelineLocation());
|
this->setupPipeline(pipelineInfo, state->pipelineLocation());
|
||||||
|
|
@ -5,34 +5,30 @@
|
|||||||
* found in the LICENSE file.
|
* found in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GrInOrderDrawBuffer_DEFINED
|
#ifndef GrBufferedDrawTarget_DEFINED
|
||||||
#define GrInOrderDrawBuffer_DEFINED
|
#define GrBufferedDrawTarget_DEFINED
|
||||||
|
|
||||||
#include "GrDrawTarget.h"
|
#include "GrDrawTarget.h"
|
||||||
#include "GrCommandBuilder.h"
|
#include "GrCommandBuilder.h"
|
||||||
#include "SkChunkAlloc.h"
|
#include "SkChunkAlloc.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GrInOrderDrawBuffer is an implementation of GrDrawTarget that queues up draws for eventual
|
* 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. When index or
|
* playback into a GrGpu. In theory one draw buffer could playback into another. Similarly, it is
|
||||||
* vertex buffers are used as geometry sources it is the callers the draw buffer only holds
|
* the caller's responsibility to ensure that all referenced textures, buffers, and render-targets
|
||||||
* references to the buffers. It is the callers responsibility to ensure that the data is still
|
* are associated in the GrGpu object that the buffer is played back into.
|
||||||
* 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.
|
|
||||||
*/
|
*/
|
||||||
class GrInOrderDrawBuffer : public GrClipTarget {
|
class GrBufferedDrawTarget : public GrClipTarget {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a GrInOrderDrawBuffer
|
* Creates a GrBufferedDrawTarget
|
||||||
*
|
*
|
||||||
* @param context the context object that owns this draw buffer.
|
* @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,
|
void clearStencilClip(const SkIRect& rect,
|
||||||
bool insideClip,
|
bool insideClip,
|
@ -349,7 +349,7 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
|
|||||||
// Either a hard (stencil buffer) clip was explicitly requested or an anti-aliased clip couldn't
|
// 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.
|
// 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.,
|
// 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.
|
// "incorrectly" clearing the AA cache.
|
||||||
fAACache.reset();
|
fAACache.reset();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "GrTargetCommands.h"
|
#include "GrTargetCommands.h"
|
||||||
|
|
||||||
class GrInOrderDrawBuffer;
|
class GrBufferedDrawTarget;
|
||||||
|
|
||||||
class GrCommandBuilder : ::SkNoncopyable {
|
class GrCommandBuilder : ::SkNoncopyable {
|
||||||
public:
|
public:
|
||||||
@ -22,7 +22,7 @@ public:
|
|||||||
virtual ~GrCommandBuilder() {}
|
virtual ~GrCommandBuilder() {}
|
||||||
|
|
||||||
void reset() { fCommands.reset(); }
|
void reset() { fCommands.reset(); }
|
||||||
void flush(GrInOrderDrawBuffer* iodb) { fCommands.flush(iodb); }
|
void flush(GrBufferedDrawTarget* bufferedDrawTarget) { fCommands.flush(bufferedDrawTarget); }
|
||||||
|
|
||||||
virtual Cmd* recordClearStencilClip(const SkIRect& rect,
|
virtual Cmd* recordClearStencilClip(const SkIRect& rect,
|
||||||
bool insideClip,
|
bool insideClip,
|
||||||
@ -39,7 +39,7 @@ public:
|
|||||||
const GrPath*,
|
const GrPath*,
|
||||||
const GrStencilSettings&) = 0;
|
const GrStencilSettings&) = 0;
|
||||||
virtual Cmd* recordDrawPaths(State*,
|
virtual Cmd* recordDrawPaths(State*,
|
||||||
GrInOrderDrawBuffer*,
|
GrBufferedDrawTarget*,
|
||||||
const GrPathProcessor*,
|
const GrPathProcessor*,
|
||||||
const GrPathRange*,
|
const GrPathRange*,
|
||||||
const void*,
|
const void*,
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "GrBatchFontCache.h"
|
#include "GrBatchFontCache.h"
|
||||||
#include "GrBatchTarget.h"
|
#include "GrBatchTarget.h"
|
||||||
#include "GrBatchTest.h"
|
#include "GrBatchTest.h"
|
||||||
|
#include "GrBufferedDrawTarget.h"
|
||||||
#include "GrCaps.h"
|
#include "GrCaps.h"
|
||||||
#include "GrContextOptions.h"
|
#include "GrContextOptions.h"
|
||||||
#include "GrDefaultGeoProcFactory.h"
|
#include "GrDefaultGeoProcFactory.h"
|
||||||
@ -22,7 +23,6 @@
|
|||||||
#include "GrGpu.h"
|
#include "GrGpu.h"
|
||||||
#include "GrImmediateDrawTarget.h"
|
#include "GrImmediateDrawTarget.h"
|
||||||
#include "GrIndexBuffer.h"
|
#include "GrIndexBuffer.h"
|
||||||
#include "GrInOrderDrawBuffer.h"
|
|
||||||
#include "GrLayerCache.h"
|
#include "GrLayerCache.h"
|
||||||
#include "GrOvalRenderer.h"
|
#include "GrOvalRenderer.h"
|
||||||
#include "GrPathRenderer.h"
|
#include "GrPathRenderer.h"
|
||||||
@ -66,7 +66,7 @@ void GrContext::DrawingMgr::init(GrContext* context) {
|
|||||||
#ifdef IMMEDIATE_MODE
|
#ifdef IMMEDIATE_MODE
|
||||||
fDrawTarget = SkNEW_ARGS(GrImmediateDrawTarget, (context));
|
fDrawTarget = SkNEW_ARGS(GrImmediateDrawTarget, (context));
|
||||||
#else
|
#else
|
||||||
fDrawTarget = SkNEW_ARGS(GrInOrderDrawBuffer, (context));
|
fDrawTarget = SkNEW_ARGS(GrBufferedDrawTarget, (context));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ void GrContext::OverBudgetCB(void* data) {
|
|||||||
|
|
||||||
GrContext* context = reinterpret_cast<GrContext*>(data);
|
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;
|
context->fFlushToReduceCacheSize = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,9 @@
|
|||||||
|
|
||||||
#include "GrInOrderCommandBuilder.h"
|
#include "GrInOrderCommandBuilder.h"
|
||||||
|
|
||||||
|
#include "GrBufferedDrawTarget.h"
|
||||||
|
|
||||||
#include "GrColor.h"
|
#include "GrColor.h"
|
||||||
#include "GrInOrderDrawBuffer.h"
|
|
||||||
#include "SkPoint.h"
|
#include "SkPoint.h"
|
||||||
|
|
||||||
static bool path_fill_type_is_winding(const GrStencilSettings& pathStencilSettings) {
|
static bool path_fill_type_is_winding(const GrStencilSettings& pathStencilSettings) {
|
||||||
@ -67,7 +68,7 @@ GrInOrderCommandBuilder::recordDrawPath(State* state,
|
|||||||
|
|
||||||
GrTargetCommands::Cmd*
|
GrTargetCommands::Cmd*
|
||||||
GrInOrderCommandBuilder::recordDrawPaths(State* state,
|
GrInOrderCommandBuilder::recordDrawPaths(State* state,
|
||||||
GrInOrderDrawBuffer* iodb,
|
GrBufferedDrawTarget* bufferedDrawTarget,
|
||||||
const GrPathProcessor* pathProc,
|
const GrPathProcessor* pathProc,
|
||||||
const GrPathRange* pathRange,
|
const GrPathRange* pathRange,
|
||||||
const void* indexValues,
|
const void* indexValues,
|
||||||
@ -84,9 +85,9 @@ GrInOrderCommandBuilder::recordDrawPaths(State* state,
|
|||||||
char* savedIndices;
|
char* savedIndices;
|
||||||
float* savedTransforms;
|
float* savedTransforms;
|
||||||
|
|
||||||
iodb->appendIndicesAndTransforms(indexValues, indexType,
|
bufferedDrawTarget->appendIndicesAndTransforms(indexValues, indexType,
|
||||||
transformValues, transformType,
|
transformValues, transformType,
|
||||||
count, &savedIndices, &savedTransforms);
|
count, &savedIndices, &savedTransforms);
|
||||||
|
|
||||||
if (!this->cmdBuffer()->empty() &&
|
if (!this->cmdBuffer()->empty() &&
|
||||||
Cmd::kDrawPaths_CmdType == this->cmdBuffer()->back().type()) {
|
Cmd::kDrawPaths_CmdType == this->cmdBuffer()->back().type()) {
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
const GrPath*,
|
const GrPath*,
|
||||||
const GrStencilSettings&) override;
|
const GrStencilSettings&) override;
|
||||||
Cmd* recordDrawPaths(State*,
|
Cmd* recordDrawPaths(State*,
|
||||||
GrInOrderDrawBuffer*,
|
GrBufferedDrawTarget*,
|
||||||
const GrPathProcessor*,
|
const GrPathProcessor*,
|
||||||
const GrPathRange*,
|
const GrPathRange*,
|
||||||
const void*,
|
const void*,
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Cmd* recordDrawPaths(State*,
|
Cmd* recordDrawPaths(State*,
|
||||||
GrInOrderDrawBuffer*,
|
GrBufferedDrawTarget*,
|
||||||
const GrPathProcessor*,
|
const GrPathProcessor*,
|
||||||
const GrPathRange*,
|
const GrPathRange*,
|
||||||
const void*,
|
const void*,
|
||||||
|
@ -7,19 +7,19 @@
|
|||||||
|
|
||||||
#include "GrTargetCommands.h"
|
#include "GrTargetCommands.h"
|
||||||
|
|
||||||
#include "GrInOrderDrawBuffer.h"
|
#include "GrBufferedDrawTarget.h"
|
||||||
|
|
||||||
void GrTargetCommands::reset() {
|
void GrTargetCommands::reset() {
|
||||||
fCmdBuffer.reset();
|
fCmdBuffer.reset();
|
||||||
fBatchTarget.reset();
|
fBatchTarget.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrTargetCommands::flush(GrInOrderDrawBuffer* iodb) {
|
void GrTargetCommands::flush(GrBufferedDrawTarget* bufferedDrawTarget) {
|
||||||
if (fCmdBuffer.empty()) {
|
if (fCmdBuffer.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GrGpu* gpu = iodb->getGpu();
|
GrGpu* gpu = bufferedDrawTarget->getGpu();
|
||||||
|
|
||||||
// Loop over all batches and generate geometry
|
// Loop over all batches and generate geometry
|
||||||
CmdBuffer::Iter genIter(fCmdBuffer);
|
CmdBuffer::Iter genIter(fCmdBuffer);
|
||||||
@ -40,7 +40,7 @@ void GrTargetCommands::flush(GrInOrderDrawBuffer* iodb) {
|
|||||||
GrGpuTraceMarker newMarker("", -1);
|
GrGpuTraceMarker newMarker("", -1);
|
||||||
SkString traceString;
|
SkString traceString;
|
||||||
if (iter->isTraced()) {
|
if (iter->isTraced()) {
|
||||||
traceString = iodb->getCmdString(iter->markerID());
|
traceString = bufferedDrawTarget->getCmdString(iter->markerID());
|
||||||
newMarker.fMarker = traceString.c_str();
|
newMarker.fMarker = traceString.c_str();
|
||||||
gpu->addGpuTraceMarker(&newMarker);
|
gpu->addGpuTraceMarker(&newMarker);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "SkRect.h"
|
#include "SkRect.h"
|
||||||
#include "SkTypes.h"
|
#include "SkTypes.h"
|
||||||
|
|
||||||
class GrInOrderDrawBuffer;
|
class GrBufferedDrawTarget;
|
||||||
|
|
||||||
|
|
||||||
class GrTargetCommands : ::SkNoncopyable {
|
class GrTargetCommands : ::SkNoncopyable {
|
||||||
@ -61,16 +61,16 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
void flush(GrInOrderDrawBuffer*);
|
void flush(GrBufferedDrawTarget*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class GrCommandBuilder;
|
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;
|
friend class GrReorderCommandBuilder;
|
||||||
|
|
||||||
typedef GrGpu::DrawArgs DrawArgs;
|
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
|
// TODO: This can be just a pipeline once paths are in batch, and it should live elsewhere
|
||||||
struct State : public SkNVRefCnt<State> {
|
struct State : public SkNVRefCnt<State> {
|
||||||
|
@ -7,9 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GrTest.h"
|
#include "GrTest.h"
|
||||||
|
|
||||||
|
#include "GrBufferedDrawTarget.h"
|
||||||
#include "GrContextOptions.h"
|
#include "GrContextOptions.h"
|
||||||
#include "GrGpuResourceCacheAccess.h"
|
#include "GrGpuResourceCacheAccess.h"
|
||||||
#include "GrInOrderDrawBuffer.h"
|
|
||||||
#include "GrResourceCache.h"
|
#include "GrResourceCache.h"
|
||||||
#include "SkString.h"
|
#include "SkString.h"
|
||||||
|
|
||||||
@ -135,7 +136,6 @@ void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT
|
|||||||
// Code for the mock context. It's built on a mock GrGpu class that does nothing.
|
// Code for the mock context. It's built on a mock GrGpu class that does nothing.
|
||||||
////
|
////
|
||||||
|
|
||||||
#include "GrInOrderDrawBuffer.h"
|
|
||||||
#include "GrGpu.h"
|
#include "GrGpu.h"
|
||||||
|
|
||||||
class GrPipeline;
|
class GrPipeline;
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
#ifndef GrTracing_DEFINED
|
#ifndef GrTracing_DEFINED
|
||||||
#define GrTracing_DEFINED
|
#define GrTracing_DEFINED
|
||||||
|
|
||||||
|
#include "GrBufferedDrawTarget.h"
|
||||||
#include "GrDrawTarget.h"
|
#include "GrDrawTarget.h"
|
||||||
#include "GrGpu.h"
|
#include "GrGpu.h"
|
||||||
#include "GrInOrderDrawBuffer.h"
|
|
||||||
#include "GrTraceMarker.h"
|
#include "GrTraceMarker.h"
|
||||||
#include "SkTraceEvent.h"
|
#include "SkTraceEvent.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user