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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 int getSaveCount() const; | 391 int getSaveCount() const; |
392 | 392 |
393 /** Efficient way to pop any calls to save() that happened after the save | 393 /** Efficient way to pop any calls to save() that happened after the save |
394 count reached saveCount. It is an error for saveCount to be greater than | 394 count reached saveCount. It is an error for saveCount to be greater than |
395 getSaveCount(). To pop all the way back to the initial matrix/clip conte
xt | 395 getSaveCount(). To pop all the way back to the initial matrix/clip conte
xt |
396 pass saveCount == 1. | 396 pass saveCount == 1. |
397 @param saveCount The number of save() levels to restore from | 397 @param saveCount The number of save() levels to restore from |
398 */ | 398 */ |
399 void restoreToCount(int saveCount); | 399 void restoreToCount(int saveCount); |
400 | 400 |
401 /** Returns true if drawing is currently going to a layer (from saveLayer) | |
402 * rather than to the root device. | |
403 */ | |
404 virtual bool isDrawingToLayer() const; | |
405 | |
406 /** Preconcat the current matrix with the specified translation | 401 /** Preconcat the current matrix with the specified translation |
407 @param dx The distance to translate in X | 402 @param dx The distance to translate in X |
408 @param dy The distance to translate in Y | 403 @param dy The distance to translate in Y |
409 */ | 404 */ |
410 void translate(SkScalar dx, SkScalar dy); | 405 void translate(SkScalar dx, SkScalar dy); |
411 | 406 |
412 /** Preconcat the current matrix with the specified scale. | 407 /** Preconcat the current matrix with the specified scale. |
413 @param sx The amount to scale in X | 408 @param sx The amount to scale in X |
414 @param sy The amount to scale in Y | 409 @param sy The amount to scale in Y |
415 */ | 410 */ |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 SkClipStack fClipStack; | 1238 SkClipStack fClipStack; |
1244 SkDeque fMCStack; | 1239 SkDeque fMCStack; |
1245 // points to top of stack | 1240 // points to top of stack |
1246 MCRec* fMCRec; | 1241 MCRec* fMCRec; |
1247 // the first N recs that can fit here mean we won't call malloc | 1242 // the first N recs that can fit here mean we won't call malloc |
1248 uint32_t fMCRecStorage[32]; | 1243 uint32_t fMCRecStorage[32]; |
1249 | 1244 |
1250 const SkSurfaceProps fProps; | 1245 const SkSurfaceProps fProps; |
1251 | 1246 |
1252 int fSaveCount; // value returned by getSaveCount() | 1247 int fSaveCount; // value returned by getSaveCount() |
1253 int fSaveLayerCount; // number of successful saveLayer calls | |
1254 | 1248 |
1255 SkMetaData* fMetaData; | 1249 SkMetaData* fMetaData; |
1256 | 1250 |
1257 SkSurface_Base* fSurfaceBase; | 1251 SkSurface_Base* fSurfaceBase; |
1258 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } | 1252 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } |
1259 void setSurfaceBase(SkSurface_Base* sb) { | 1253 void setSurfaceBase(SkSurface_Base* sb) { |
1260 fSurfaceBase = sb; | 1254 fSurfaceBase = sb; |
1261 } | 1255 } |
1262 friend class SkSurface_Base; | 1256 friend class SkSurface_Base; |
1263 friend class SkSurface_Gpu; | 1257 friend class SkSurface_Gpu; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 | 1485 |
1492 class SkCanvasClipVisitor { | 1486 class SkCanvasClipVisitor { |
1493 public: | 1487 public: |
1494 virtual ~SkCanvasClipVisitor(); | 1488 virtual ~SkCanvasClipVisitor(); |
1495 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1489 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1496 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1490 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1497 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1491 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1498 }; | 1492 }; |
1499 | 1493 |
1500 #endif | 1494 #endif |
OLD | NEW |