| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 @param device Specifies a device for the canvas to draw into. | 94 @param device Specifies a device for the canvas to draw into. |
| 95 */ | 95 */ |
| 96 explicit SkCanvas(SkBaseDevice* device); | 96 explicit SkCanvas(SkBaseDevice* device); |
| 97 | 97 |
| 98 /** Construct a canvas with the specified bitmap to draw into. | 98 /** Construct a canvas with the specified bitmap to draw into. |
| 99 @param bitmap Specifies a bitmap for the canvas to draw into. Its | 99 @param bitmap Specifies a bitmap for the canvas to draw into. Its |
| 100 structure are copied to the canvas. | 100 structure are copied to the canvas. |
| 101 */ | 101 */ |
| 102 explicit SkCanvas(const SkBitmap& bitmap); | 102 explicit SkCanvas(const SkBitmap& bitmap); |
| 103 |
| 104 /** Construct a canvas with the specified bitmap to draw into. |
| 105 @param bitmap Specifies a bitmap for the canvas to draw into. Its |
| 106 structure are copied to the canvas. |
| 107 @param props New canvas surface properties. |
| 108 */ |
| 109 SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props); |
| 110 |
| 103 virtual ~SkCanvas(); | 111 virtual ~SkCanvas(); |
| 104 | 112 |
| 105 SkMetaData& getMetaData(); | 113 SkMetaData& getMetaData(); |
| 106 | 114 |
| 107 /** | 115 /** |
| 108 * Return ImageInfo for this canvas. If the canvas is not backed by pixels | 116 * Return ImageInfo for this canvas. If the canvas is not backed by pixels |
| 109 * (cpu or gpu), then the info's ColorType will be kUnknown_SkColorType. | 117 * (cpu or gpu), then the info's ColorType will be kUnknown_SkColorType. |
| 110 */ | 118 */ |
| 111 SkImageInfo imageInfo() const; | 119 SkImageInfo imageInfo() const; |
| 112 | 120 |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 friend class SkRecorder; // InitFlags | 1279 friend class SkRecorder; // InitFlags |
| 1272 friend class SkNoSaveLayerCanvas; // InitFlags | 1280 friend class SkNoSaveLayerCanvas; // InitFlags |
| 1273 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp
s*, InitFlags) | 1281 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp
s*, InitFlags) |
| 1274 | 1282 |
| 1275 enum InitFlags { | 1283 enum InitFlags { |
| 1276 kDefault_InitFlags = 0, | 1284 kDefault_InitFlags = 0, |
| 1277 kConservativeRasterClip_InitFlag = 1 << 0, | 1285 kConservativeRasterClip_InitFlag = 1 << 0, |
| 1278 }; | 1286 }; |
| 1279 SkCanvas(const SkIRect& bounds, InitFlags); | 1287 SkCanvas(const SkIRect& bounds, InitFlags); |
| 1280 SkCanvas(SkBaseDevice*, const SkSurfaceProps*, InitFlags); | 1288 SkCanvas(SkBaseDevice*, const SkSurfaceProps*, InitFlags); |
| 1281 SkCanvas(const SkBitmap&, const SkSurfaceProps&); | |
| 1282 | 1289 |
| 1283 // needs gettotalclip() | 1290 // needs gettotalclip() |
| 1284 friend class SkCanvasStateUtils; | 1291 friend class SkCanvasStateUtils; |
| 1285 | 1292 |
| 1286 // call this each time we attach ourselves to a device | 1293 // call this each time we attach ourselves to a device |
| 1287 // - constructor | 1294 // - constructor |
| 1288 // - internalSaveLayer | 1295 // - internalSaveLayer |
| 1289 void setupDevice(SkBaseDevice*); | 1296 void setupDevice(SkBaseDevice*); |
| 1290 | 1297 |
| 1291 SkBaseDevice* init(SkBaseDevice*, InitFlags); | 1298 SkBaseDevice* init(SkBaseDevice*, InitFlags); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 | 1492 |
| 1486 class SkCanvasClipVisitor { | 1493 class SkCanvasClipVisitor { |
| 1487 public: | 1494 public: |
| 1488 virtual ~SkCanvasClipVisitor(); | 1495 virtual ~SkCanvasClipVisitor(); |
| 1489 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1496 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
| 1490 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1497 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
| 1491 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1498 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
| 1492 }; | 1499 }; |
| 1493 | 1500 |
| 1494 #endif | 1501 #endif |
| OLD | NEW |