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

Unified Diff: src/gpu/GrTextureParamsAdjuster.h

Issue 1507973005: Make "alpha only" be a property of GrTextureProducer (Closed) Base URL: https://skia.googlesource.com/skia.git@producernine
Patch Set: fix unused var Created 5 years 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/GrImageIDTextureAdjuster.cpp ('k') | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextureParamsAdjuster.h
diff --git a/src/gpu/GrTextureParamsAdjuster.h b/src/gpu/GrTextureParamsAdjuster.h
index ed9f142af0f6d4e7ce36626906042df0fb7fc42f..103bcbf7208099d33ce73a92b4d1e3d34b84a1fa 100644
--- a/src/gpu/GrTextureParamsAdjuster.h
+++ b/src/gpu/GrTextureParamsAdjuster.h
@@ -70,9 +70,13 @@ public:
int width() const { return fWidth; }
int height() const { return fHeight; }
+ bool isAlphaOnly() const { return fIsAlphaOnly; }
protected:
- GrTextureProducer(int width, int height) : fWidth(width), fHeight(height) {}
+ GrTextureProducer(int width, int height, bool isAlphaOnly)
+ : fWidth(width)
+ , fHeight(height)
+ , fIsAlphaOnly(isAlphaOnly) {}
/** Helper for creating a key for a copy from an original key. */
static void MakeCopyKeyFromOrigKey(const GrUniqueKey& origKey,
@@ -104,8 +108,9 @@ protected:
virtual void didCacheCopy(const GrUniqueKey& copyKey) = 0;
private:
- const int fWidth;
- const int fHeight;
+ const int fWidth;
+ const int fHeight;
+ const bool fIsAlphaOnly;
typedef SkNoncopyable INHERITED;
};
@@ -133,11 +138,11 @@ public:
protected:
/** The whole texture is content. */
- explicit GrTextureAdjuster(GrTexture* original)
- : INHERITED(original->width(), original->height())
+ explicit GrTextureAdjuster(GrTexture* original, bool isAlphaOnly)
+ : INHERITED(original->width(), original->height(), isAlphaOnly)
, fOriginal(original) {}
- GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea);
+ GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea, bool isAlphaOnly);
GrTexture* originalTexture() const { return fOriginal; }
@@ -170,8 +175,8 @@ public:
const GrTextureParams::FilterMode* filterOrNullForBicubic) override;
protected:
- GrTextureMaker(GrContext* context, int width, int height)
- : INHERITED(width, height)
+ GrTextureMaker(GrContext* context, int width, int height, bool isAlphaOnly)
+ : INHERITED(width, height, isAlphaOnly)
, fContext(context) {}
/**
« no previous file with comments | « src/gpu/GrImageIDTextureAdjuster.cpp ('k') | src/gpu/GrTextureParamsAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698