Chromium Code Reviews| Index: src/gpu/SkGpuDevice.h |
| diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h |
| index f71450d7c99faa82db85e1fb88037da63778b1b2..ed6ad028313ee32f76e3479a61751779ead5a1a5 100644 |
| --- a/src/gpu/SkGpuDevice.h |
| +++ b/src/gpu/SkGpuDevice.h |
| @@ -30,21 +30,22 @@ struct GrCachedLayer; |
| */ |
| class SK_API SkGpuDevice : public SkBaseDevice { |
| public: |
| - enum Flags { |
| - kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear |
| + enum InitContents { |
|
reed1
2015/06/23 20:05:03
Boy oh boy, we should consider this sort of thing
|
| + kClear_InitContents, |
| + kUninit_InitContents |
| }; |
| /** |
| * Creates an SkGpuDevice from a GrRenderTarget. |
| */ |
| - static SkGpuDevice* Create(GrRenderTarget* target, const SkSurfaceProps*, unsigned flags = 0); |
| + static SkGpuDevice* Create(GrRenderTarget* target, const SkSurfaceProps*, InitContents); |
| /** |
| * Creates an SkGpuDevice from a GrRenderTarget whose texture width/height is |
| * different than its actual width/height (e.g., approx-match scratch texture). |
| */ |
| static SkGpuDevice* Create(GrRenderTarget* target, int width, int height, |
| - const SkSurfaceProps*, unsigned flags = 0); |
| + const SkSurfaceProps*, InitContents); |
| /** |
| * New device that will create an offscreen renderTarget based on the ImageInfo and |
| @@ -52,7 +53,7 @@ public: |
| * the resource cache budget. On failure, returns NULL. |
| */ |
| static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInfo&, |
| - int sampleCount, const SkSurfaceProps*, unsigned flags = 0); |
| + int sampleCount, const SkSurfaceProps*, InitContents); |
| virtual ~SkGpuDevice(); |
| @@ -153,6 +154,15 @@ private: |
| // remove when our clients don't rely on accessBitmap() |
| SkBitmap fLegacyBitmap; |
| bool fNeedClear; |
| + bool fOpaque; |
| + |
| + enum Flags { |
| + kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear |
| + kIsOpaque_Flag = 1 << 1, //!< Hint from client that rendering to this device will be |
| + // opaque even if the config supports alpha. |
| + }; |
|
robertphillips
2015/06/23 19:48:09
Do we need the "SkGpuDevice::" here ?
bsalomon
2015/06/25 21:47:18
Done.
|
| + static bool CheckAlphaTypeAndGetFlags(const SkImageInfo* info, SkGpuDevice::InitContents init, |
| + unsigned* flags); |
| SkGpuDevice(GrRenderTarget*, int width, int height, const SkSurfaceProps*, unsigned flags); |