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 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 class MCRec; | 1399 class MCRec; |
1400 | 1400 |
1401 SkAutoTUnref<SkClipStack> fClipStack; | 1401 SkAutoTUnref<SkClipStack> fClipStack; |
1402 SkDeque fMCStack; | 1402 SkDeque fMCStack; |
1403 // points to top of stack | 1403 // points to top of stack |
1404 MCRec* fMCRec; | 1404 MCRec* fMCRec; |
1405 // the first N recs that can fit here mean we won't call malloc | 1405 // the first N recs that can fit here mean we won't call malloc |
1406 enum { | 1406 enum { |
1407 kMCRecSize = 128, // most recent measurement | 1407 kMCRecSize = 128, // most recent measurement |
1408 kMCRecCount = 32, // common depth for save/restores | 1408 kMCRecCount = 32, // common depth for save/restores |
1409 kDeviceCMSize = 136, // most recent measurement | 1409 kDeviceCMSize = 176, // most recent measurement |
1410 }; | 1410 }; |
1411 intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)]; | 1411 intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)]; |
1412 intptr_t fDeviceCMStorage[kDeviceCMSize / sizeof(intptr_t)]; | 1412 intptr_t fDeviceCMStorage[kDeviceCMSize / sizeof(intptr_t)]; |
1413 | 1413 |
1414 const SkSurfaceProps fProps; | 1414 const SkSurfaceProps fProps; |
1415 | 1415 |
1416 int fSaveCount; // value returned by getSaveCount() | 1416 int fSaveCount; // value returned by getSaveCount() |
1417 | 1417 |
1418 SkMetaData* fMetaData; | 1418 SkMetaData* fMetaData; |
1419 | 1419 |
1420 SkSurface_Base* fSurfaceBase; | 1420 SkSurface_Base* fSurfaceBase; |
1421 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } | 1421 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } |
1422 void setSurfaceBase(SkSurface_Base* sb) { | 1422 void setSurfaceBase(SkSurface_Base* sb) { |
1423 fSurfaceBase = sb; | 1423 fSurfaceBase = sb; |
1424 } | 1424 } |
1425 friend class SkSurface_Base; | 1425 friend class SkSurface_Base; |
1426 friend class SkSurface_Gpu; | 1426 friend class SkSurface_Gpu; |
1427 | 1427 |
1428 bool fDeviceCMDirty; // cleared by updateDeviceCMCache() | 1428 bool fDeviceCMDirty; // cleared by updateDeviceCMCache() |
1429 void updateDeviceCMCache(); | 1429 void updateDeviceCMCache(); |
1430 | 1430 |
1431 void doSave(); | 1431 void doSave(); |
1432 void checkForDeferredSave(); | 1432 void checkForDeferredSave(); |
| 1433 void internalSetMatrix(const SkMatrix&); |
1433 | 1434 |
1434 friend class SkDrawIter; // needs setupDrawForLayerDevice() | 1435 friend class SkDrawIter; // needs setupDrawForLayerDevice() |
1435 friend class AutoDrawLooper; | 1436 friend class AutoDrawLooper; |
1436 friend class SkLua; // needs top layer size and offset | 1437 friend class SkLua; // needs top layer size and offset |
1437 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip | 1438 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip |
1438 friend class SkSurface_Raster; // needs getDevice() | 1439 friend class SkSurface_Raster; // needs getDevice() |
1439 friend class SkRecorder; // InitFlags | 1440 friend class SkRecorder; // InitFlags |
1440 friend class SkNoSaveLayerCanvas; // InitFlags | 1441 friend class SkNoSaveLayerCanvas; // InitFlags |
1441 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp
s*, InitFlags) | 1442 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp
s*, InitFlags) |
1442 friend class SkPictureRecord; // predrawNotify (why does it need it? <reed
>) | 1443 friend class SkPictureRecord; // predrawNotify (why does it need it? <reed
>) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 | 1577 |
1577 class SkCanvasClipVisitor { | 1578 class SkCanvasClipVisitor { |
1578 public: | 1579 public: |
1579 virtual ~SkCanvasClipVisitor(); | 1580 virtual ~SkCanvasClipVisitor(); |
1580 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1581 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1581 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1582 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1582 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1583 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1583 }; | 1584 }; |
1584 | 1585 |
1585 #endif | 1586 #endif |
OLD | NEW |