Chromium Code Reviews| 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 |
| 11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
| 13 #include "SkDeque.h" | 13 #include "SkDeque.h" |
| 14 #include "SkClipStack.h" | 14 #include "SkClipStack.h" |
| 15 #include "SkPaint.h" | 15 #include "SkPaint.h" |
| 16 #include "SkRefCnt.h" | 16 #include "SkRefCnt.h" |
| 17 #include "SkPath.h" | 17 #include "SkPath.h" |
| 18 #include "SkRegion.h" | 18 #include "SkRegion.h" |
| 19 #include "SkXfermode.h" | 19 #include "SkXfermode.h" |
| 20 | 20 |
| 21 // if not defined, we always assume ClipToLayer for saveLayer() | |
| 22 //#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG | |
| 23 | |
| 24 | |
| 21 //#define SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG | 25 //#define SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG |
| 22 | 26 |
| 23 class SkBounder; | 27 class SkBounder; |
| 24 class SkBaseDevice; | 28 class SkBaseDevice; |
| 25 class SkDraw; | 29 class SkDraw; |
| 26 class SkDrawFilter; | 30 class SkDrawFilter; |
| 27 class SkMetaData; | 31 class SkMetaData; |
| 28 class SkPicture; | 32 class SkPicture; |
| 29 class SkRRect; | 33 class SkRRect; |
| 30 class SkSurface; | 34 class SkSurface; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 enum SaveFlags { | 321 enum SaveFlags { |
| 318 /** save the matrix state, restoring it on restore() */ | 322 /** save the matrix state, restoring it on restore() */ |
| 319 kMatrix_SaveFlag = 0x01, | 323 kMatrix_SaveFlag = 0x01, |
| 320 /** save the clip state, restoring it on restore() */ | 324 /** save the clip state, restoring it on restore() */ |
| 321 kClip_SaveFlag = 0x02, | 325 kClip_SaveFlag = 0x02, |
| 322 /** the layer needs to support per-pixel alpha */ | 326 /** the layer needs to support per-pixel alpha */ |
| 323 kHasAlphaLayer_SaveFlag = 0x04, | 327 kHasAlphaLayer_SaveFlag = 0x04, |
| 324 /** the layer needs to support 8-bits per color component */ | 328 /** the layer needs to support 8-bits per color component */ |
| 325 kFullColorLayer_SaveFlag = 0x08, | 329 kFullColorLayer_SaveFlag = 0x08, |
| 326 /** the layer should clip against the bounds argument */ | 330 /** the layer should clip against the bounds argument */ |
| 327 kClipToLayer_SaveFlag = 0x10, | 331 kClipToLayer_SaveFlag = 0x10, |
|
scroggo
2014/03/07 19:52:31
Maybe add a comment here?
It seems odd to have a
reed1
2014/03/07 20:02:42
Done.
| |
| 328 | 332 |
| 329 // helper masks for common choices | 333 // helper masks for common choices |
| 330 kMatrixClip_SaveFlag = 0x03, | 334 kMatrixClip_SaveFlag = 0x03, |
| 335 #ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG | |
| 331 kARGB_NoClipLayer_SaveFlag = 0x0F, | 336 kARGB_NoClipLayer_SaveFlag = 0x0F, |
| 337 #endif | |
| 332 kARGB_ClipLayer_SaveFlag = 0x1F | 338 kARGB_ClipLayer_SaveFlag = 0x1F |
| 333 }; | 339 }; |
| 334 | 340 |
| 335 /** This call saves the current matrix, clip, and drawFilter, and pushes a | 341 /** This call saves the current matrix, clip, and drawFilter, and pushes a |
| 336 copy onto a private stack. Subsequent calls to translate, scale, | 342 copy onto a private stack. Subsequent calls to translate, scale, |
| 337 rotate, skew, concat or clipRect, clipPath, and setDrawFilter all | 343 rotate, skew, concat or clipRect, clipPath, and setDrawFilter all |
| 338 operate on this copy. | 344 operate on this copy. |
| 339 When the balancing call to restore() is made, the previous matrix, clip, | 345 When the balancing call to restore() is made, the previous matrix, clip, |
| 340 and drawFilter are restored. | 346 and drawFilter are restored. |
| 341 @param flags The flags govern what portion of the Matrix/Clip/drawFilter | 347 @param flags The flags govern what portion of the Matrix/Clip/drawFilter |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1397 bool asROBitmap(SkBitmap*) const; | 1403 bool asROBitmap(SkBitmap*) const; |
| 1398 | 1404 |
| 1399 private: | 1405 private: |
| 1400 SkBitmap fBitmap; // used if peekPixels() fails | 1406 SkBitmap fBitmap; // used if peekPixels() fails |
| 1401 const void* fAddr; // NULL on failure | 1407 const void* fAddr; // NULL on failure |
| 1402 SkImageInfo fInfo; | 1408 SkImageInfo fInfo; |
| 1403 size_t fRowBytes; | 1409 size_t fRowBytes; |
| 1404 }; | 1410 }; |
| 1405 | 1411 |
| 1406 #endif | 1412 #endif |
| OLD | NEW |