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

Unified Diff: src/gpu/GrTextureParamsAdjuster.cpp

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/GrTextureParamsAdjuster.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextureParamsAdjuster.cpp
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index 4456980e858f478cc94be1bff90888a3f7b6b320..20b77cb8449dc001ef0b2073766f0f350f624258 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -112,11 +112,14 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset,
return copyDC->asTexture().release();
}
-GrTextureAdjuster::GrTextureAdjuster(GrTexture* original,
- const SkIRect& contentArea,
- bool isAlphaOnly)
- : INHERITED(contentArea.width(), contentArea.height(), isAlphaOnly)
- , fOriginal(original) {
+GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, const SkIRect& contentArea,
+ uint32_t uniqueID, SkColorSpace* cs)
+ : INHERITED(contentArea.width(), contentArea.height(),
+ GrPixelConfigIsAlphaOnly(original->config()))
+ , fOriginal(original)
+ , fColorSpace(cs)
+ , fUniqueID(uniqueID)
+{
SkASSERT(SkIRect::MakeWH(original->width(), original->height()).contains(contentArea));
if (contentArea.fLeft > 0 || contentArea.fTop > 0 ||
contentArea.fRight < original->width() || contentArea.fBottom < original->height()) {
@@ -124,6 +127,20 @@ GrTextureAdjuster::GrTextureAdjuster(GrTexture* original,
}
}
+void GrTextureAdjuster::makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) {
+ GrUniqueKey baseKey;
+ GrMakeKeyFromImageID(&baseKey, fUniqueID, SkIRect::MakeWH(this->width(), this->height()));
+ MakeCopyKeyFromOrigKey(baseKey, params, copyKey);
+}
+
+void GrTextureAdjuster::didCacheCopy(const GrUniqueKey& copyKey) {
+ // We don't currently have a mechanism for notifications on Images!
+}
+
+SkColorSpace* GrTextureAdjuster::getColorSpace() {
+ return fColorSpace;
+}
+
GrTexture* GrTextureAdjuster::refCopy(const CopyParams& copyParams) {
GrTexture* texture = this->originalTexture();
GrContext* context = texture->getContext();
« no previous file with comments | « src/gpu/GrTextureParamsAdjuster.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698