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

Unified Diff: tools/viewer/sk_app/WindowContext.cpp

Issue 2165703002: Make sk_app::WindowContext directly create a SkSurface without an intermediate GrRenderTarget (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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
« tools/viewer/sk_app/WindowContext.h ('K') | « tools/viewer/sk_app/WindowContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/WindowContext.cpp
diff --git a/tools/viewer/sk_app/WindowContext.cpp b/tools/viewer/sk_app/WindowContext.cpp
index ba04e7eace9837bd267a6f220346bfaba6d8c74c..5d364bc497bf8273572480c19af6f035c428f2c2 100755
--- a/tools/viewer/sk_app/WindowContext.cpp
+++ b/tools/viewer/sk_app/WindowContext.cpp
@@ -25,12 +25,12 @@ sk_sp<SkSurface> WindowContext::createOffscreenSurface(bool forceSRGB) {
return createSurface(nullptr, 0, true, forceSRGB);
}
-sk_sp<SkSurface> WindowContext::createRenderSurface(sk_sp<GrRenderTarget> rt, int colorBits) {
- return createSurface(rt, colorBits, false, false);
+sk_sp<SkSurface> WindowContext::createRenderSurface(GrBackendRenderTargetDesc desc, int colorBits) {
+ return createSurface(&desc, colorBits, false, false);
}
sk_sp<SkSurface> WindowContext::createSurface(
- sk_sp<GrRenderTarget> rt, int colorBits, bool offscreen, bool forceSRGB) {
+ GrBackendRenderTargetDesc* rtDesc, int colorBits, bool offscreen, bool forceSRGB) {
auto flags = (fSurfaceProps.flags() & ~SkSurfaceProps::kGammaCorrect_Flag) |
(GrPixelConfigIsSRGB(fPixelConfig) || forceSRGB ?
SkSurfaceProps::kGammaCorrect_Flag : 0);
@@ -57,7 +57,7 @@ sk_sp<SkSurface> WindowContext::createSurface(
return SkSurface::MakeRaster(info, &props);
}
} else {
- return SkSurface::MakeRenderTargetDirect(rt.get(), &props);
+ return SkSurface::MakeFromBackendRenderTarget(fContext, *rtDesc, &props);
}
}
« tools/viewer/sk_app/WindowContext.h ('K') | « tools/viewer/sk_app/WindowContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698