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

Unified Diff: src/gpu/GrTextureParamsAdjuster.h

Issue 2242373002: simplify GrTextureAdjuster given there is only one subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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/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 4377ae5af3ad11c92e104916a0398d0745a6e47a..879c6605f8e7d880cd4d75f06a5708aca51f557c 100644
--- a/src/gpu/GrTextureParamsAdjuster.h
+++ b/src/gpu/GrTextureParamsAdjuster.h
@@ -142,13 +142,14 @@ public:
SkColorSpace* dstColorSpace,
SkSourceGammaTreatment) override;
-protected:
- /** The whole texture is content. */
- explicit GrTextureAdjuster(GrTexture* original, bool isAlphaOnly)
- : INHERITED(original->width(), original->height(), isAlphaOnly)
- , fOriginal(original) {}
+ // We do not ref the texture nor the colorspace, so the caller must keep them in scope while
+ // this Adjuster is alive.
+ GrTextureAdjuster(GrTexture*, const SkIRect& area, uint32_t uniqueID, SkColorSpace*);
- GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea, bool isAlphaOnly);
+protected:
+ SkColorSpace* getColorSpace() override;
+ void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override;
+ void didCacheCopy(const GrUniqueKey& copyKey) override;
GrTexture* originalTexture() const { return fOriginal; }
@@ -158,6 +159,8 @@ protected:
private:
SkTLazy<SkIRect> fContentArea;
GrTexture* fOriginal;
+ SkColorSpace* fColorSpace;
+ uint32_t fUniqueID;
GrTexture* refCopy(const CopyParams &copyParams);
« 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