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

Unified Diff: src/core/SkSpecialImage.cpp

Issue 1925313002: Tighten up SkSpecialSurface factory functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | src/core/SkSpecialSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSpecialImage.cpp
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index f18e6a7c7c109bf33552bbca2917c4bdc20bcb58..420b3f1e2336998afa571b2f6c5e40b603dc009e 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -252,10 +252,12 @@ public:
#if SK_SUPPORT_GPU
GrTexture* texture = as_IB(fImage.get())->peekTexture();
if (texture) {
- GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(info, *texture->getContext()->caps());
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ GrPixelConfig config = SkImageInfo2GrPixelConfig(info, *texture->getContext()->caps());
- return SkSpecialSurface::MakeRenderTarget(texture->getContext(), desc);
+ return SkSpecialSurface::MakeRenderTarget(texture->getContext(),
+ info.width(),
+ info.height(),
+ config);
}
#endif
return SkSpecialSurface::MakeRaster(info, nullptr);
@@ -528,10 +530,11 @@ public:
return nullptr;
}
- GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(info, *fTexture->getContext()->caps());
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ GrPixelConfig config = SkImageInfo2GrPixelConfig(info, *fTexture->getContext()->caps());
- return SkSpecialSurface::MakeRenderTarget(fTexture->getContext(), desc);
+ return SkSpecialSurface::MakeRenderTarget(fTexture->getContext(),
+ info.width(), info.height(),
+ config);
}
sk_sp<SkSpecialImage> onMakeSubset(const SkIRect& subset) const override {
« no previous file with comments | « no previous file | src/core/SkSpecialSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698