aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrReducedClip.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-28 08:40:11 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-28 18:26:06 +0000
commita4f792da37eada1dcc05c50b152e20ac36a0977c (patch)
treed3db9341255808f27be24c4f737d3289bf574457 /src/gpu/GrReducedClip.cpp
parentc55a6cb05f6bb06261f46d7bfc872dc18d587aff (diff)
Fix for Android batching bug
On Android it looks like we have: stencilClip1 draw1 stencilClip2 draw2 where draw1 is being forward combined with draw2 b.c. they are both stencil clipped but it shouldn't b.c. they are different stencil clips. Change-Id: Ia704d7ab869022a055eed0726e2b7fab8eaaf817 Reviewed-on: https://skia-review.googlesource.com/20977 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrReducedClip.cpp')
-rw-r--r--src/gpu/GrReducedClip.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index 8c98ac1c71..dfa41668d4 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -662,7 +662,11 @@ bool GrReducedClip::drawAlphaClipMask(GrRenderTargetContext* rtc) const {
class StencilClip final : public GrClip {
public:
- StencilClip(const SkIRect& scissorRect) : fFixedClip(scissorRect) {}
+ StencilClip(const SkIRect& scissorRect, int32_t clipStackID)
+ : fFixedClip(scissorRect)
+ , fClipStackID(clipStackID) {
+ }
+
const GrFixedClip& fixedClip() const { return fFixedClip; }
void setWindowRectangles(const GrWindowRectangles& windows, GrWindowRectsState::Mode mode) {
@@ -685,11 +689,12 @@ private:
bounds)) {
return false;
}
- out->addStencilClip();
+ out->addStencilClip(fClipStackID);
return true;
}
GrFixedClip fFixedClip;
+ int32_t fClipStackID;
typedef GrClip INHERITED;
};
@@ -697,7 +702,7 @@ private:
bool GrReducedClip::drawStencilClipMask(GrContext* context,
GrRenderTargetContext* renderTargetContext) const {
// We set the current clip to the bounds so that our recursive draws are scissored to them.
- StencilClip stencilClip(fIBounds);
+ StencilClip stencilClip(fIBounds, this->elementsGenID());
if (!fWindowRects.empty()) {
stencilClip.setWindowRectangles(fWindowRects, GrWindowRectsState::Mode::kExclusive);