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 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 91 |
| 92 /** Construct a canvas with the specified device to draw into. | 92 /** Construct a canvas with the specified device to draw into. |
| 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 @param props If specified, these are the new canvas surface propertie s. | |
|
reed1
2015/01/30 20:18:26
// If NULL is passed, we use ...(?)... for the pro
f(malita)
2015/02/01 03:46:29
Argh. After trying to come up with a good descript
| |
| 101 */ | 102 */ |
| 102 explicit SkCanvas(const SkBitmap& bitmap); | 103 explicit SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps* props = NULL ); |
|
reed1
2015/01/30 20:18:26
Can't use explicit when we have more than one para
| |
| 103 virtual ~SkCanvas(); | 104 virtual ~SkCanvas(); |
| 104 | 105 |
| 105 SkMetaData& getMetaData(); | 106 SkMetaData& getMetaData(); |
| 106 | 107 |
| 107 /** | 108 /** |
| 108 * Return ImageInfo for this canvas. If the canvas is not backed by pixels | 109 * 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. | 110 * (cpu or gpu), then the info's ColorType will be kUnknown_SkColorType. |
| 110 */ | 111 */ |
| 111 SkImageInfo imageInfo() const; | 112 SkImageInfo imageInfo() const; |
| 112 | 113 |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1271 friend class SkRecorder; // InitFlags | 1272 friend class SkRecorder; // InitFlags |
| 1272 friend class SkNoSaveLayerCanvas; // InitFlags | 1273 friend class SkNoSaveLayerCanvas; // InitFlags |
| 1273 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp s*, InitFlags) | 1274 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp s*, InitFlags) |
| 1274 | 1275 |
| 1275 enum InitFlags { | 1276 enum InitFlags { |
| 1276 kDefault_InitFlags = 0, | 1277 kDefault_InitFlags = 0, |
| 1277 kConservativeRasterClip_InitFlag = 1 << 0, | 1278 kConservativeRasterClip_InitFlag = 1 << 0, |
| 1278 }; | 1279 }; |
| 1279 SkCanvas(const SkIRect& bounds, InitFlags); | 1280 SkCanvas(const SkIRect& bounds, InitFlags); |
| 1280 SkCanvas(SkBaseDevice*, const SkSurfaceProps*, InitFlags); | 1281 SkCanvas(SkBaseDevice*, const SkSurfaceProps*, InitFlags); |
| 1281 SkCanvas(const SkBitmap&, const SkSurfaceProps&); | |
| 1282 | 1282 |
| 1283 // needs gettotalclip() | 1283 // needs gettotalclip() |
| 1284 friend class SkCanvasStateUtils; | 1284 friend class SkCanvasStateUtils; |
| 1285 | 1285 |
| 1286 // call this each time we attach ourselves to a device | 1286 // call this each time we attach ourselves to a device |
| 1287 // - constructor | 1287 // - constructor |
| 1288 // - internalSaveLayer | 1288 // - internalSaveLayer |
| 1289 void setupDevice(SkBaseDevice*); | 1289 void setupDevice(SkBaseDevice*); |
| 1290 | 1290 |
| 1291 SkBaseDevice* init(SkBaseDevice*, InitFlags); | 1291 SkBaseDevice* init(SkBaseDevice*, InitFlags); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1485 | 1485 |
| 1486 class SkCanvasClipVisitor { | 1486 class SkCanvasClipVisitor { |
| 1487 public: | 1487 public: |
| 1488 virtual ~SkCanvasClipVisitor(); | 1488 virtual ~SkCanvasClipVisitor(); |
| 1489 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1489 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
| 1490 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1490 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
| 1491 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1491 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
| 1492 }; | 1492 }; |
| 1493 | 1493 |
| 1494 #endif | 1494 #endif |
| OLD | NEW |