| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 #ifndef SkCanvas_DEFINED | 8 #ifndef SkCanvas_DEFINED |
| 9 #define SkCanvas_DEFINED | 9 #define SkCanvas_DEFINED |
| 10 | 10 |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 void drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b, | 614 void drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b, |
| 615 SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode); | 615 SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode); |
| 616 | 616 |
| 617 /** Fill the entire canvas' bitmap (restricted to the current clip) with the | 617 /** Fill the entire canvas' bitmap (restricted to the current clip) with the |
| 618 specified color and mode. | 618 specified color and mode. |
| 619 @param color the color to draw with | 619 @param color the color to draw with |
| 620 @param mode the mode to apply the color in (defaults to SrcOver) | 620 @param mode the mode to apply the color in (defaults to SrcOver) |
| 621 */ | 621 */ |
| 622 void drawColor(SkColor color, SkXfermode::Mode mode = SkXfermode::kSrcOver_M
ode); | 622 void drawColor(SkColor color, SkXfermode::Mode mode = SkXfermode::kSrcOver_M
ode); |
| 623 | 623 |
| 624 // TODO: remove virtual when chrome subclass stop overriding this. | 624 /** |
| 625 virtual void clear(SkColor color) { | 625 * Helper method for drawing a color in SRC mode, completely replacing all
the pixels |
| 626 * in the current clip with this color. |
| 627 */ |
| 628 void clear(SkColor color) { |
| 626 this->drawColor(color, SkXfermode::kSrc_Mode); | 629 this->drawColor(color, SkXfermode::kSrc_Mode); |
| 627 } | 630 } |
| 628 | 631 |
| 629 /** | 632 /** |
| 630 * This makes the contents of the canvas undefined. Subsequent calls that | 633 * This makes the contents of the canvas undefined. Subsequent calls that |
| 631 * require reading the canvas contents will produce undefined results. Examp
les | 634 * require reading the canvas contents will produce undefined results. Examp
les |
| 632 * include blending and readPixels. The actual implementation is backend- | 635 * include blending and readPixels. The actual implementation is backend- |
| 633 * dependent and one legal implementation is to do nothing. Like clear(), th
is | 636 * dependent and one legal implementation is to do nothing. Like clear(), th
is |
| 634 * ignores the clip. | 637 * ignores the clip. |
| 635 * | 638 * |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1536 | 1539 |
| 1537 class SkCanvasClipVisitor { | 1540 class SkCanvasClipVisitor { |
| 1538 public: | 1541 public: |
| 1539 virtual ~SkCanvasClipVisitor(); | 1542 virtual ~SkCanvasClipVisitor(); |
| 1540 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1543 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
| 1541 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1544 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
| 1542 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1545 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
| 1543 }; | 1546 }; |
| 1544 | 1547 |
| 1545 #endif | 1548 #endif |
| OLD | NEW |