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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 @return The current matrix on the canvas. | 1074 @return The current matrix on the canvas. |
1075 */ | 1075 */ |
1076 const SkMatrix& getTotalMatrix() const; | 1076 const SkMatrix& getTotalMatrix() const; |
1077 | 1077 |
1078 /** Return the clip stack. The clip stack stores all the individual | 1078 /** Return the clip stack. The clip stack stores all the individual |
1079 * clips organized by the save/restore frame in which they were | 1079 * clips organized by the save/restore frame in which they were |
1080 * added. | 1080 * added. |
1081 * @return the current clip stack ("list" of individual clip elements) | 1081 * @return the current clip stack ("list" of individual clip elements) |
1082 */ | 1082 */ |
1083 const SkClipStack* getClipStack() const { | 1083 const SkClipStack* getClipStack() const { |
1084 return &fClipStack; | 1084 return fClipStack; |
1085 } | 1085 } |
1086 | 1086 |
1087 typedef SkCanvasClipVisitor ClipVisitor; | 1087 typedef SkCanvasClipVisitor ClipVisitor; |
1088 /** | 1088 /** |
1089 * Replays the clip operations, back to front, that have been applied to | 1089 * Replays the clip operations, back to front, that have been applied to |
1090 * the canvas, calling the appropriate method on the visitor for each | 1090 * the canvas, calling the appropriate method on the visitor for each |
1091 * clip. All clips have already been transformed into device space. | 1091 * clip. All clips have already been transformed into device space. |
1092 */ | 1092 */ |
1093 void replayClips(ClipVisitor*) const; | 1093 void replayClips(ClipVisitor*) const; |
1094 | 1094 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 SkIRect* intersection, | 1236 SkIRect* intersection, |
1237 const SkImageFilter* imageFilter = NULL); | 1237 const SkImageFilter* imageFilter = NULL); |
1238 | 1238 |
1239 // notify our surface (if we have one) that we are about to draw, so it | 1239 // notify our surface (if we have one) that we are about to draw, so it |
1240 // can perform copy-on-write or invalidate any cached images | 1240 // can perform copy-on-write or invalidate any cached images |
1241 void predrawNotify(); | 1241 void predrawNotify(); |
1242 | 1242 |
1243 private: | 1243 private: |
1244 class MCRec; | 1244 class MCRec; |
1245 | 1245 |
1246 SkClipStack fClipStack; | 1246 SkAutoTUnref<SkClipStack> fClipStack; |
1247 SkDeque fMCStack; | 1247 SkDeque fMCStack; |
1248 // points to top of stack | 1248 // points to top of stack |
1249 MCRec* fMCRec; | 1249 MCRec* fMCRec; |
1250 // the first N recs that can fit here mean we won't call malloc | 1250 // the first N recs that can fit here mean we won't call malloc |
1251 uint32_t fMCRecStorage[32]; | 1251 uint32_t fMCRecStorage[32]; |
1252 | 1252 |
1253 const SkSurfaceProps fProps; | 1253 const SkSurfaceProps fProps; |
1254 | 1254 |
1255 int fSaveCount; // value returned by getSaveCount() | 1255 int fSaveCount; // value returned by getSaveCount() |
1256 | 1256 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 | 1492 |
1493 class SkCanvasClipVisitor { | 1493 class SkCanvasClipVisitor { |
1494 public: | 1494 public: |
1495 virtual ~SkCanvasClipVisitor(); | 1495 virtual ~SkCanvasClipVisitor(); |
1496 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1496 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1497 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1497 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1498 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1498 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1499 }; | 1499 }; |
1500 | 1500 |
1501 #endif | 1501 #endif |
OLD | NEW |