Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Unified Diff: src/gpu/SkGpuDevice.h

Issue 1205643002: Make SkGpuDevice know its alpha type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix bench pictures :( Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrSurfacePriv.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.h
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index f71450d7c99faa82db85e1fb88037da63778b1b2..9fa756c29a2bfb855720081f0f845c07cb0df06d 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 {
+ 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.
+ };
+ static bool CheckAlphaTypeAndGetFlags(const SkImageInfo* info, InitContents init,
+ unsigned* flags);
SkGpuDevice(GrRenderTarget*, int width, int height, const SkSurfaceProps*, unsigned flags);
« no previous file with comments | « src/gpu/GrSurfacePriv.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698