Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: src/gpu/GrGpu.h

Issue 683673002: clear stencil clip on draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@aa_rect_takes_gpu
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 6814ae979b681757b92755a3b59842a4566c3965..8fa81d62cb9db44c90e65f38873bf8b12e775932 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -23,7 +23,7 @@ class GrPathRendererChain;
class GrStencilBuffer;
class GrVertexBufferAllocPool;
-class GrGpu : public GrDrawTarget {
+class GrGpu : public GrClipTarget {
public:
/**
@@ -272,6 +272,10 @@ public:
bool canIgnoreRect,
GrRenderTarget* renderTarget = NULL) SK_OVERRIDE;
+ virtual void clearStencilClip(const SkIRect& rect,
+ bool insideClip,
+ GrRenderTarget* renderTarget = NULL) SK_OVERRIDE;
+
virtual void purgeResources() SK_OVERRIDE {
// The clip mask manager can rebuild all its clip masks so just
// get rid of them all.
@@ -295,11 +299,6 @@ public:
return fResetTimestamp;
}
- // GrGpu subclass sets clip bit in the stencil buffer. The subclass is
- // free to clear the remaining bits to zero if masked clears are more
- // expensive than clearing all bits.
- virtual void clearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideClip) = 0;
-
enum PrivateDrawStateStateBits {
kFirstBit = (GrDrawState::kLastPublicStateBit << 1),
@@ -422,6 +421,13 @@ private:
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
+ // ONLY used by the the clip target
+ virtual void onClearStencilClip(GrRenderTarget*,
+ const SkIRect& rect,
+ bool insideClip) = 0;
+
// overridden by backend-specific derived class to perform the draw call.
virtual void onGpuDraw(const DrawInfo&) = 0;
@@ -454,7 +460,7 @@ private:
// backend-specific flush of the state.
// returns false if current state is unsupported.
virtual bool flushGraphicsState(DrawType,
- const ScissorState&,
+ const GrClipMaskManager::ScissorState&,
const GrDeviceCoordTexture* dstCopy) = 0;
// clears target's entire stencil buffer to 0
@@ -507,7 +513,7 @@ private:
// these are mutable so they can be created on-demand
mutable GrIndexBuffer* fQuadIndexBuffer;
- typedef GrDrawTarget INHERITED;
+ typedef GrClipTarget INHERITED;
};
#endif
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698