| 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 |
| 11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
| 13 #include "SkDeque.h" | 13 #include "SkDeque.h" |
| 14 #include "SkClipStack.h" | 14 #include "SkClipStack.h" |
| 15 #include "SkPaint.h" | 15 #include "SkPaint.h" |
| 16 #include "SkRefCnt.h" | 16 #include "SkRefCnt.h" |
| 17 #include "SkPath.h" | 17 #include "SkPath.h" |
| 18 #include "SkRegion.h" | 18 #include "SkRegion.h" |
| 19 #include "SkXfermode.h" | 19 #include "SkXfermode.h" |
| 20 | 20 |
| 21 #ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL | 21 #ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL |
| 22 #define SK_LEGACY_DRAWTEXT_VIRTUAL virtual | 22 #define SK_LEGACY_DRAWTEXT_VIRTUAL virtual |
| 23 #else | 23 #else |
| 24 #define SK_LEGACY_DRAWTEXT_VIRTUAL | 24 #define SK_LEGACY_DRAWTEXT_VIRTUAL |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 class SkCanvasClipVisitor; |
| 27 class SkBaseDevice; | 28 class SkBaseDevice; |
| 28 class SkDraw; | 29 class SkDraw; |
| 29 class SkDrawFilter; | 30 class SkDrawFilter; |
| 30 class SkMetaData; | 31 class SkMetaData; |
| 31 class SkPicture; | 32 class SkPicture; |
| 32 class SkRRect; | 33 class SkRRect; |
| 33 class SkSurface; | 34 class SkSurface; |
| 34 class SkSurface_Base; | 35 class SkSurface_Base; |
| 35 class GrContext; | 36 class GrContext; |
| 36 class GrRenderTarget; | 37 class GrRenderTarget; |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 | 1128 |
| 1128 /** Return the clip stack. The clip stack stores all the individual | 1129 /** Return the clip stack. The clip stack stores all the individual |
| 1129 * clips organized by the save/restore frame in which they were | 1130 * clips organized by the save/restore frame in which they were |
| 1130 * added. | 1131 * added. |
| 1131 * @return the current clip stack ("list" of individual clip elements) | 1132 * @return the current clip stack ("list" of individual clip elements) |
| 1132 */ | 1133 */ |
| 1133 const SkClipStack* getClipStack() const { | 1134 const SkClipStack* getClipStack() const { |
| 1134 return &fClipStack; | 1135 return &fClipStack; |
| 1135 } | 1136 } |
| 1136 | 1137 |
| 1137 class ClipVisitor { | 1138 typedef SkCanvasClipVisitor ClipVisitor; |
| 1138 public: | |
| 1139 virtual ~ClipVisitor(); | |
| 1140 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | |
| 1141 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0
; | |
| 1142 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | |
| 1143 }; | |
| 1144 | |
| 1145 /** | 1139 /** |
| 1146 * Replays the clip operations, back to front, that have been applied to | 1140 * Replays the clip operations, back to front, that have been applied to |
| 1147 * the canvas, calling the appropriate method on the visitor for each | 1141 * the canvas, calling the appropriate method on the visitor for each |
| 1148 * clip. All clips have already been transformed into device space. | 1142 * clip. All clips have already been transformed into device space. |
| 1149 */ | 1143 */ |
| 1150 void replayClips(ClipVisitor*) const; | 1144 void replayClips(ClipVisitor*) const; |
| 1151 | 1145 |
| 1152 /////////////////////////////////////////////////////////////////////////// | 1146 /////////////////////////////////////////////////////////////////////////// |
| 1153 | 1147 |
| 1154 /** After calling saveLayer(), there can be any number of devices that make | 1148 /** After calling saveLayer(), there can be any number of devices that make |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 const SkCanvas::SaveFlags rhs) { | 1491 const SkCanvas::SaveFlags rhs) { |
| 1498 return static_cast<SkCanvas::SaveFlags>(static_cast<int>(lhs) | static_cast<
int>(rhs)); | 1492 return static_cast<SkCanvas::SaveFlags>(static_cast<int>(lhs) | static_cast<
int>(rhs)); |
| 1499 } | 1493 } |
| 1500 | 1494 |
| 1501 static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs, | 1495 static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs, |
| 1502 const SkCanvas::SaveFlags rhs) { | 1496 const SkCanvas::SaveFlags rhs) { |
| 1503 lhs = lhs | rhs; | 1497 lhs = lhs | rhs; |
| 1504 return lhs; | 1498 return lhs; |
| 1505 } | 1499 } |
| 1506 | 1500 |
| 1501 class SkCanvasClipVisitor { |
| 1502 public: |
| 1503 virtual ~SkCanvasClipVisitor(); |
| 1504 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
| 1505 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
| 1506 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
| 1507 }; |
| 1507 | 1508 |
| 1508 #endif | 1509 #endif |
| OLD | NEW |