Index: gm/aaclip.cpp |
diff --git a/gm/aaclip.cpp b/gm/aaclip.cpp |
index 1cb71577990ba75759a5c72c42db5ec42d4eb9b3..adc776fe680120f6bbd56d09aca3b4701b77e1f0 100644 |
--- a/gm/aaclip.cpp |
+++ b/gm/aaclip.cpp |
@@ -9,6 +9,27 @@ |
#include "SkCanvas.h" |
#include "SkPath.h" |
+static void do_draw(SkCanvas* canvas, const SkRect& r) { |
+ SkPaint paint; |
+ paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
+ paint.setColor(0x800000FF); |
+ canvas->drawRect(r, paint); |
+} |
+ |
+DEF_SIMPLE_GM(dont_clip_to_layer, canvas, 350, 120) { |
mtklein
2016/09/06 14:05:19
were there going to be 2 more horizontally?
reed1
2016/09/06 14:36:32
The scrolling code in android sometimes does that:
mtklein
2016/09/06 14:51:21
Sorry, was just wondering about why this was so wi
reed1
2016/09/06 15:06:29
Ah, gotcha. Will fix.
|
+ SkRect r { 10, 10, 110, 110 }; |
+ SkRect r0 = SkRect::MakeXYWH(r.left(), r.top(), r.width(), r.height()/2); |
+ |
+ SkCanvas::SaveLayerRec rec; |
+ rec.fPaint = nullptr; |
+ rec.fBounds = &r0; |
+ rec.fBackdrop = nullptr; |
+ rec.fSaveLayerFlags = 1 << 31;//SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag; |
+ canvas->saveLayer(rec); |
mtklein
2016/09/06 14:05:19
Can you add a comment about the effect that we're
reed1
2016/09/06 14:36:32
Done.
|
+ do_draw(canvas, r); |
+ canvas->restore(); |
+} |
+ |
/** Draw a 2px border around the target, then red behind the target; |
set the clip to match the target, then draw >> the target in blue. |
*/ |