| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| 11 | 11 |
| 12 static void do_draw(SkCanvas* canvas, const SkRect& r) { | 12 static void do_draw(SkCanvas* canvas, const SkRect& r) { |
| 13 SkPaint paint; | 13 SkPaint paint; |
| 14 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 14 paint.setBlendMode(SkBlendMode::kSrc); |
| 15 paint.setColor(0x800000FF); | 15 paint.setColor(0x800000FF); |
| 16 canvas->drawRect(r, paint); | 16 canvas->drawRect(r, paint); |
| 17 } | 17 } |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Exercise kDontClipToLayer_Legacy_SaveLayerFlag flag, which does not limit th
e clip to the | 20 * Exercise kDontClipToLayer_Legacy_SaveLayerFlag flag, which does not limit th
e clip to the |
| 21 * layer's bounds. Thus when a draw occurs, it can (depending on "where" it is)
draw into the layer | 21 * layer's bounds. Thus when a draw occurs, it can (depending on "where" it is)
draw into the layer |
| 22 * and/or draw onto the surrounding portions of the canvas, or both. | 22 * and/or draw onto the surrounding portions of the canvas, or both. |
| 23 * | 23 * |
| 24 * This GM has a 100x100 rectangle (r), which its going to draw. However first
it creates a layer | 24 * This GM has a 100x100 rectangle (r), which its going to draw. However first
it creates a layer |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 canvas->translate(80, 10); | 309 canvas->translate(80, 10); |
| 310 this->drawAndClip(canvas, fVPath, 200, 0); | 310 this->drawAndClip(canvas, fVPath, 200, 0); |
| 311 canvas->translate(0, 200); | 311 canvas->translate(0, 200); |
| 312 this->drawAndClip(canvas, fHPath, 200, 0); | 312 this->drawAndClip(canvas, fHPath, 200, 0); |
| 313 } | 313 } |
| 314 | 314 |
| 315 private: | 315 private: |
| 316 typedef skiagm::GM INHERITED; | 316 typedef skiagm::GM INHERITED; |
| 317 }; | 317 }; |
| 318 DEF_GM(return new ClipCubicGM;) | 318 DEF_GM(return new ClipCubicGM;) |
| OLD | NEW |