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 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 @return The current matrix on the canvas. | 1082 @return The current matrix on the canvas. |
1083 */ | 1083 */ |
1084 const SkMatrix& getTotalMatrix() const; | 1084 const SkMatrix& getTotalMatrix() const; |
1085 | 1085 |
1086 /** Return the clip stack. The clip stack stores all the individual | 1086 /** Return the clip stack. The clip stack stores all the individual |
1087 * clips organized by the save/restore frame in which they were | 1087 * clips organized by the save/restore frame in which they were |
1088 * added. | 1088 * added. |
1089 * @return the current clip stack ("list" of individual clip elements) | 1089 * @return the current clip stack ("list" of individual clip elements) |
1090 */ | 1090 */ |
1091 const SkClipStack* getClipStack() const { | 1091 const SkClipStack* getClipStack() const { |
1092 return &fClipStack; | 1092 return fClipStack; |
1093 } | 1093 } |
1094 | 1094 |
1095 typedef SkCanvasClipVisitor ClipVisitor; | 1095 typedef SkCanvasClipVisitor ClipVisitor; |
1096 /** | 1096 /** |
1097 * Replays the clip operations, back to front, that have been applied to | 1097 * Replays the clip operations, back to front, that have been applied to |
1098 * the canvas, calling the appropriate method on the visitor for each | 1098 * the canvas, calling the appropriate method on the visitor for each |
1099 * clip. All clips have already been transformed into device space. | 1099 * clip. All clips have already been transformed into device space. |
1100 */ | 1100 */ |
1101 void replayClips(ClipVisitor*) const; | 1101 void replayClips(ClipVisitor*) const; |
1102 | 1102 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 SkIRect* intersection, | 1244 SkIRect* intersection, |
1245 const SkImageFilter* imageFilter = NULL); | 1245 const SkImageFilter* imageFilter = NULL); |
1246 | 1246 |
1247 // notify our surface (if we have one) that we are about to draw, so it | 1247 // notify our surface (if we have one) that we are about to draw, so it |
1248 // can perform copy-on-write or invalidate any cached images | 1248 // can perform copy-on-write or invalidate any cached images |
1249 void predrawNotify(); | 1249 void predrawNotify(); |
1250 | 1250 |
1251 private: | 1251 private: |
1252 class MCRec; | 1252 class MCRec; |
1253 | 1253 |
1254 SkClipStack fClipStack; | 1254 SkAutoTUnref<SkClipStack> fClipStack; |
1255 SkDeque fMCStack; | 1255 SkDeque fMCStack; |
1256 // points to top of stack | 1256 // points to top of stack |
1257 MCRec* fMCRec; | 1257 MCRec* fMCRec; |
1258 // the first N recs that can fit here mean we won't call malloc | 1258 // the first N recs that can fit here mean we won't call malloc |
1259 enum { | 1259 enum { |
1260 kMCRecSize = 128, // most recent measurement | 1260 kMCRecSize = 128, // most recent measurement |
1261 kMCRecCount = 8, // common depth for save/restores | 1261 kMCRecCount = 8, // common depth for save/restores |
1262 }; | 1262 }; |
1263 intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)]; | 1263 intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)]; |
1264 // for our base DeviceCM | 1264 // for our base DeviceCM |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 | 1496 |
1497 class SkCanvasClipVisitor { | 1497 class SkCanvasClipVisitor { |
1498 public: | 1498 public: |
1499 virtual ~SkCanvasClipVisitor(); | 1499 virtual ~SkCanvasClipVisitor(); |
1500 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1500 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1501 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1501 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1502 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1502 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1503 }; | 1503 }; |
1504 | 1504 |
1505 #endif | 1505 #endif |
OLD | NEW |