Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 //#define SK_SUPPORT_LEGACY_GETTOTALCLIP | 26 //#define SK_SUPPORT_LEGACY_GETTOTALCLIP |
| 27 //#define SK_SUPPORT_LEGACY_GETTOPDEVICE | 27 //#define SK_SUPPORT_LEGACY_GETTOPDEVICE |
| 28 | 28 |
| 29 //#define SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL | 29 //#define SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL |
| 30 #ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL | 30 #ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL |
| 31 #define SK_LEGACY_DRAWTEXT_VIRTUAL virtual | 31 #define SK_LEGACY_DRAWTEXT_VIRTUAL virtual |
| 32 #else | 32 #else |
| 33 #define SK_LEGACY_DRAWTEXT_VIRTUAL | 33 #define SK_LEGACY_DRAWTEXT_VIRTUAL |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 class SkCanvasClipVisitor; | |
| 36 class SkBounder; | 37 class SkBounder; |
| 37 class SkBaseDevice; | 38 class SkBaseDevice; |
| 38 class SkDraw; | 39 class SkDraw; |
| 39 class SkDrawFilter; | 40 class SkDrawFilter; |
| 40 class SkMetaData; | 41 class SkMetaData; |
| 41 class SkPicture; | 42 class SkPicture; |
| 42 class SkRRect; | 43 class SkRRect; |
| 43 class SkSurface; | 44 class SkSurface; |
| 44 class SkSurface_Base; | 45 class SkSurface_Base; |
| 45 class GrContext; | 46 class GrContext; |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1142 | 1143 |
| 1143 /** Return the clip stack. The clip stack stores all the individual | 1144 /** Return the clip stack. The clip stack stores all the individual |
| 1144 * clips organized by the save/restore frame in which they were | 1145 * clips organized by the save/restore frame in which they were |
| 1145 * added. | 1146 * added. |
| 1146 * @return the current clip stack ("list" of individual clip elements) | 1147 * @return the current clip stack ("list" of individual clip elements) |
| 1147 */ | 1148 */ |
| 1148 const SkClipStack* getClipStack() const { | 1149 const SkClipStack* getClipStack() const { |
| 1149 return &fClipStack; | 1150 return &fClipStack; |
| 1150 } | 1151 } |
| 1151 | 1152 |
| 1152 class ClipVisitor { | 1153 typedef SkCanvasClipVisitor ClipVisitor; |
| 1153 public: | |
| 1154 virtual ~ClipVisitor(); | |
| 1155 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | |
| 1156 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0 ; | |
| 1157 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | |
| 1158 }; | |
| 1159 | |
| 1160 /** | 1154 /** |
| 1161 * Replays the clip operations, back to front, that have been applied to | 1155 * Replays the clip operations, back to front, that have been applied to |
| 1162 * the canvas, calling the appropriate method on the visitor for each | 1156 * the canvas, calling the appropriate method on the visitor for each |
| 1163 * clip. All clips have already been transformed into device space. | 1157 * clip. All clips have already been transformed into device space. |
| 1164 */ | 1158 */ |
| 1165 void replayClips(ClipVisitor*) const; | 1159 void replayClips(ClipVisitor*) const; |
| 1166 | 1160 |
| 1167 /////////////////////////////////////////////////////////////////////////// | 1161 /////////////////////////////////////////////////////////////////////////// |
| 1168 | 1162 |
| 1169 /** After calling saveLayer(), there can be any number of devices that make | 1163 /** After calling saveLayer(), there can be any number of devices that make |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1496 // that the bitmap may reference the address returned by peekPixels(), so | 1490 // that the bitmap may reference the address returned by peekPixels(), so |
| 1497 // the caller must respect the restrictions associated with peekPixels(). | 1491 // the caller must respect the restrictions associated with peekPixels(). |
| 1498 bool asROBitmap(SkBitmap*) const; | 1492 bool asROBitmap(SkBitmap*) const; |
| 1499 | 1493 |
| 1500 private: | 1494 private: |
| 1501 SkBitmap fBitmap; // used if peekPixels() fails | 1495 SkBitmap fBitmap; // used if peekPixels() fails |
| 1502 const void* fAddr; // NULL on failure | 1496 const void* fAddr; // NULL on failure |
| 1503 SkImageInfo fInfo; | 1497 SkImageInfo fInfo; |
| 1504 size_t fRowBytes; | 1498 size_t fRowBytes; |
| 1505 }; | 1499 }; |
| 1506 | 1500 |
|
robertphillips
2014/05/02 12:35:38
I know this isn't due to this CL but, why isn't cl
f(malita)
2014/05/02 12:59:26
You just put your finger on my biggest concern: Sk
| |
| 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 }; | |
| 1508 | |
| 1507 #endif | 1509 #endif |
| OLD | NEW |