aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrDrawTarget.cpp2
-rw-r--r--src/gpu/GrDrawTarget.h7
-rw-r--r--src/gpu/GrGpu.cpp12
-rw-r--r--src/gpu/GrGpu.h46
-rw-r--r--src/gpu/GrInOrderDrawBuffer.cpp8
-rw-r--r--src/gpu/GrInOrderDrawBuffer.h3
-rw-r--r--src/gpu/GrTest.cpp6
-rw-r--r--src/gpu/gl/GrGpuGL.cpp6
-rw-r--r--src/gpu/gl/GrGpuGL.h6
9 files changed, 40 insertions, 56 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 89300f7e5f..82f1e60e49 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -687,7 +687,6 @@ void GrDrawTarget::addGpuTraceMarker(const GrGpuTraceMarker* marker) {
if (this->caps()->gpuTracingSupport()) {
SkASSERT(fGpuTraceMarkerCount >= 0);
this->fActiveTraceMarkers.add(*marker);
- this->didAddGpuTraceMarker();
++fGpuTraceMarkerCount;
}
}
@@ -696,7 +695,6 @@ void GrDrawTarget::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
if (this->caps()->gpuTracingSupport()) {
SkASSERT(fGpuTraceMarkerCount >= 1);
this->fActiveTraceMarkers.remove(*marker);
- this->didRemoveGpuTraceMarker();
--fGpuTraceMarkerCount;
}
}
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 74be6460e1..41f9b366fc 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -885,9 +885,6 @@ private:
GrRenderTarget* renderTarget) = 0;
- virtual void didAddGpuTraceMarker() = 0;
- virtual void didRemoveGpuTraceMarker() = 0;
-
// helpers for reserving vertex and index space.
bool reserveVertexSpace(size_t vertexSize,
int vertexCount,
@@ -926,10 +923,6 @@ private:
GrTraceMarkerSet fActiveTraceMarkers;
GrTraceMarkerSet fStoredTraceMarkers;
- // TODO fix this
- friend class GrGpu;
- friend class GrGpuGL;
-
typedef SkRefCnt INHERITED;
};
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index e9bf0001aa..64ee29bde5 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -184,7 +184,7 @@ void GrGpu::clear(const SkIRect* rect,
GrRenderTarget* renderTarget) {
SkASSERT(renderTarget);
this->handleDirtyContext();
- this->onGpuClear(renderTarget, rect, color, canIgnoreRect);
+ this->onClear(renderTarget, rect, color, canIgnoreRect);
}
void GrGpu::clearStencilClip(const SkIRect& rect,
@@ -323,7 +323,7 @@ const GrIndexBuffer* GrGpu::getQuadIndexBuffer() const {
////////////////////////////////////////////////////////////////////////////////
-void GrGpu::onDraw(const GrDrawTarget::DrawInfo& info,
+void GrGpu::draw(const GrDrawTarget::DrawInfo& info,
const GrClipMaskManager::ScissorState& scissorState) {
this->handleDirtyContext();
if (!this->flushGraphicsState(PrimTypeToDrawType(info.primitiveType()),
@@ -331,10 +331,10 @@ void GrGpu::onDraw(const GrDrawTarget::DrawInfo& info,
info.getDstCopy())) {
return;
}
- this->onGpuDraw(info);
+ this->onDraw(info);
}
-void GrGpu::onStencilPath(const GrPath* path,
+void GrGpu::stencilPath(const GrPath* path,
const GrClipMaskManager::ScissorState& scissorState,
const GrStencilSettings& stencilSettings) {
this->handleDirtyContext();
@@ -347,7 +347,7 @@ void GrGpu::onStencilPath(const GrPath* path,
}
-void GrGpu::onDrawPath(const GrPath* path,
+void GrGpu::drawPath(const GrPath* path,
const GrClipMaskManager::ScissorState& scissorState,
const GrStencilSettings& stencilSettings,
const GrDeviceCoordTexture* dstCopy) {
@@ -360,7 +360,7 @@ void GrGpu::onDrawPath(const GrPath* path,
this->pathRendering()->drawPath(path, stencilSettings);
}
-void GrGpu::onDrawPaths(const GrPathRange* pathRange,
+void GrGpu::drawPaths(const GrPathRange* pathRange,
const uint32_t indices[],
int count,
const float transforms[],
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index af3502add7..5279ce8b39 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -412,6 +412,24 @@ public:
*/
void setIndexSourceToBuffer(const GrIndexBuffer* buffer);
+ virtual void draw(const GrDrawTarget::DrawInfo&,
+ const GrClipMaskManager::ScissorState&);
+ virtual void stencilPath(const GrPath*,
+ const GrClipMaskManager::ScissorState&,
+ const GrStencilSettings&);
+ virtual void drawPath(const GrPath*,
+ const GrClipMaskManager::ScissorState&,
+ const GrStencilSettings&,
+ const GrDeviceCoordTexture* dstCopy);
+ virtual void drawPaths(const GrPathRange*,
+ const uint32_t indices[],
+ int count,
+ const float transforms[],
+ GrDrawTarget::PathTransformType,
+ const GrClipMaskManager::ScissorState&,
+ const GrStencilSettings&,
+ const GrDeviceCoordTexture*);
+
protected:
DrawType PrimTypeToDrawType(GrPrimitiveType type) {
switch (type) {
@@ -484,8 +502,8 @@ private:
virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0;
// overridden by backend-specific derived class to perform the clear.
- virtual void onGpuClear(GrRenderTarget*, const SkIRect* rect, GrColor color,
- bool canIgnoreRect) = 0;
+ virtual void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color,
+ bool canIgnoreRect) = 0;
// Overridden by backend specific classes to perform a clear of the stencil clip bits. This is
@@ -495,7 +513,7 @@ private:
bool insideClip) = 0;
// overridden by backend-specific derived class to perform the draw call.
- virtual void onGpuDraw(const GrDrawTarget::DrawInfo&) = 0;
+ virtual void onDraw(const GrDrawTarget::DrawInfo&) = 0;
// overridden by backend-specific derived class to perform the read pixels.
virtual bool onReadPixels(GrRenderTarget* target,
@@ -535,25 +553,6 @@ private:
// Given a rt, find or create a stencil buffer and attach it
bool attachStencilBufferToRenderTarget(GrRenderTarget* target);
- // GrDrawTarget overrides
- virtual void onDraw(const GrDrawTarget::DrawInfo&,
- const GrClipMaskManager::ScissorState&);
- virtual void onStencilPath(const GrPath*,
- const GrClipMaskManager::ScissorState&,
- const GrStencilSettings&);
- virtual void onDrawPath(const GrPath*,
- const GrClipMaskManager::ScissorState&,
- const GrStencilSettings&,
- const GrDeviceCoordTexture* dstCopy);
- virtual void onDrawPaths(const GrPathRange*,
- const uint32_t indices[],
- int count,
- const float transforms[],
- GrDrawTarget::PathTransformType,
- const GrClipMaskManager::ScissorState&,
- const GrStencilSettings&,
- const GrDeviceCoordTexture*);
-
virtual void didAddGpuTraceMarker() = 0;
virtual void didRemoveGpuTraceMarker() = 0;
@@ -583,9 +582,6 @@ private:
// The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
GrContext* fContext;
- // TODO fix this
- friend class GrInOrderDrawBuffer;
-
typedef SkRefCnt INHERITED;
};
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 875734d8a5..9835200598 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -473,20 +473,20 @@ void GrInOrderDrawBuffer::Draw::execute(GrGpu* gpu) {
if (fInfo.isIndexed()) {
gpu->setIndexSourceToBuffer(this->indexBuffer());
}
- gpu->onDraw(fInfo, fScissorState);
+ gpu->draw(fInfo, fScissorState);
}
void GrInOrderDrawBuffer::StencilPath::execute(GrGpu* gpu) {
- gpu->onStencilPath(this->path(), fScissorState, fStencilSettings);
+ gpu->stencilPath(this->path(), fScissorState, fStencilSettings);
}
void GrInOrderDrawBuffer::DrawPath::execute(GrGpu* gpu) {
- gpu->onDrawPath(this->path(), fScissorState, fStencilSettings,
+ gpu->drawPath(this->path(), fScissorState, fStencilSettings,
fDstCopy.texture() ? &fDstCopy : NULL);
}
void GrInOrderDrawBuffer::DrawPaths::execute(GrGpu* gpu) {
- gpu->onDrawPaths(this->pathRange(), this->indices(), fCount, this->transforms(),
+ gpu->drawPaths(this->pathRange(), this->indices(), fCount, this->transforms(),
fTransformsType, fScissorState, fStencilSettings,
fDstCopy.texture() ? &fDstCopy : NULL);
}
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 61bd51331b..ed62a93247 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -283,9 +283,6 @@ private:
virtual void willReserveVertexAndIndexSpace(int vertexCount,
int indexCount) SK_OVERRIDE;
- virtual void didAddGpuTraceMarker() SK_OVERRIDE {}
- virtual void didRemoveGpuTraceMarker() SK_OVERRIDE {}
-
// Attempts to concat instances from info onto the previous draw. info must represent an
// instanced draw. The caller must have already recorded a new draw state and clip if necessary.
int concatInstancedDraw(const DrawInfo& info, const GrClipMaskManager::ScissorState&);
diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp
index 5d31c15c06..b176d3c0fc 100644
--- a/src/gpu/GrTest.cpp
+++ b/src/gpu/GrTest.cpp
@@ -111,14 +111,14 @@ private:
return NULL;
}
- virtual void onGpuClear(GrRenderTarget*, const SkIRect* rect, GrColor color,
- bool canIgnoreRect) SK_OVERRIDE { }
+ virtual void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color,
+ bool canIgnoreRect) SK_OVERRIDE { }
virtual void onClearStencilClip(GrRenderTarget*,
const SkIRect& rect,
bool insideClip) SK_OVERRIDE { }
- virtual void onGpuDraw(const GrDrawTarget::DrawInfo&) SK_OVERRIDE { }
+ virtual void onDraw(const GrDrawTarget::DrawInfo&) SK_OVERRIDE { }
virtual bool onReadPixels(GrRenderTarget* target,
int left, int top, int width, int height,
GrPixelConfig,
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 3fc5543fb4..888f818993 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -1354,8 +1354,8 @@ void GrGpuGL::disableScissor() {
}
}
-void GrGpuGL::onGpuClear(GrRenderTarget* target, const SkIRect* rect, GrColor color,
- bool canIgnoreRect) {
+void GrGpuGL::onClear(GrRenderTarget* target, const SkIRect* rect, GrColor color,
+ bool canIgnoreRect) {
// parent class should never let us get here with no RT
SkASSERT(target);
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
@@ -1729,7 +1729,7 @@ GrGLenum gPrimitiveType2GLMode[] = {
#endif
#endif
-void GrGpuGL::onGpuDraw(const GrDrawTarget::DrawInfo& info) {
+void GrGpuGL::onDraw(const GrDrawTarget::DrawInfo& info) {
size_t indexOffsetInBytes;
this->setupGeometry(info, &indexOffsetInBytes);
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index bba6400f46..fc7ad4e273 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -132,8 +132,8 @@ private:
GrStencilBuffer* sb,
GrRenderTarget* rt) SK_OVERRIDE;
- virtual void onGpuClear(GrRenderTarget*, const SkIRect* rect, GrColor color,
- bool canIgnoreRect) SK_OVERRIDE;
+ virtual void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color,
+ bool canIgnoreRect) SK_OVERRIDE;
virtual void onClearStencilClip(GrRenderTarget*,
const SkIRect& rect,
@@ -153,7 +153,7 @@ private:
virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE;
- virtual void onGpuDraw(const GrDrawTarget::DrawInfo&) SK_OVERRIDE;
+ virtual void onDraw(const GrDrawTarget::DrawInfo&) SK_OVERRIDE;
virtual void clearStencil(GrRenderTarget*) SK_OVERRIDE;