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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 class MCRec; | 1254 class MCRec; |
1255 | 1255 |
1256 SkAutoTUnref<SkClipStack> fClipStack; | 1256 SkAutoTUnref<SkClipStack> fClipStack; |
1257 SkDeque fMCStack; | 1257 SkDeque fMCStack; |
1258 // points to top of stack | 1258 // points to top of stack |
1259 MCRec* fMCRec; | 1259 MCRec* fMCRec; |
1260 // the first N recs that can fit here mean we won't call malloc | 1260 // the first N recs that can fit here mean we won't call malloc |
1261 enum { | 1261 enum { |
1262 kMCRecSize = 128, // most recent measurement | 1262 kMCRecSize = 128, // most recent measurement |
1263 kMCRecCount = 8, // common depth for save/restores | 1263 kMCRecCount = 8, // common depth for save/restores |
1264 kDeviceCMSize = 176, // most recent measurement | 1264 kDeviceCMSize = 136, // most recent measurement |
1265 }; | 1265 }; |
1266 intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)]; | 1266 intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)]; |
1267 intptr_t fDeviceCMStorage[kDeviceCMSize / sizeof(intptr_t)]; | 1267 intptr_t fDeviceCMStorage[kDeviceCMSize / sizeof(intptr_t)]; |
1268 | 1268 |
1269 const SkSurfaceProps fProps; | 1269 const SkSurfaceProps fProps; |
1270 | 1270 |
1271 int fSaveCount; // value returned by getSaveCount() | 1271 int fSaveCount; // value returned by getSaveCount() |
1272 | 1272 |
1273 SkMetaData* fMetaData; | 1273 SkMetaData* fMetaData; |
1274 | 1274 |
1275 SkSurface_Base* fSurfaceBase; | 1275 SkSurface_Base* fSurfaceBase; |
1276 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } | 1276 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } |
1277 void setSurfaceBase(SkSurface_Base* sb) { | 1277 void setSurfaceBase(SkSurface_Base* sb) { |
1278 fSurfaceBase = sb; | 1278 fSurfaceBase = sb; |
1279 } | 1279 } |
1280 friend class SkSurface_Base; | 1280 friend class SkSurface_Base; |
1281 friend class SkSurface_Gpu; | 1281 friend class SkSurface_Gpu; |
1282 | 1282 |
1283 bool fDeviceCMDirty; // cleared by updateDeviceCMCache() | 1283 bool fDeviceCMDirty; // cleared by updateDeviceCMCache() |
1284 void updateDeviceCMCache(); | 1284 void updateDeviceCMCache(); |
1285 | 1285 |
1286 void doSave(); | 1286 void doSave(); |
1287 void checkForDeferredSave(); | 1287 void checkForDeferredSave(); |
1288 void internalSetMatrix(const SkMatrix& matrix); | |
1289 | 1288 |
1290 friend class SkDrawIter; // needs setupDrawForLayerDevice() | 1289 friend class SkDrawIter; // needs setupDrawForLayerDevice() |
1291 friend class AutoDrawLooper; | 1290 friend class AutoDrawLooper; |
1292 friend class SkLua; // needs top layer size and offset | 1291 friend class SkLua; // needs top layer size and offset |
1293 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip | 1292 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip |
1294 friend class SkDeferredDevice; // needs getTopDevice() | 1293 friend class SkDeferredDevice; // needs getTopDevice() |
1295 friend class SkSurface_Raster; // needs getDevice() | 1294 friend class SkSurface_Raster; // needs getDevice() |
1296 friend class SkRecorder; // InitFlags | 1295 friend class SkRecorder; // InitFlags |
1297 friend class SkNoSaveLayerCanvas; // InitFlags | 1296 friend class SkNoSaveLayerCanvas; // InitFlags |
1298 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp
s*, InitFlags) | 1297 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp
s*, InitFlags) |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 | 1500 |
1502 class SkCanvasClipVisitor { | 1501 class SkCanvasClipVisitor { |
1503 public: | 1502 public: |
1504 virtual ~SkCanvasClipVisitor(); | 1503 virtual ~SkCanvasClipVisitor(); |
1505 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1504 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1506 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1505 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1507 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1506 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1508 }; | 1507 }; |
1509 | 1508 |
1510 #endif | 1509 #endif |
OLD | NEW |