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

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

Issue 2184273002: Remove unused sk_app::WindowContext::presentRenderSurface (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
« no previous file with comments | « 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 458f66a67b9a74fb4f99ab4d1715be2ebe89b5fa..b5039a397079595970d6c16bb214969ab28f22a9 100755
--- a/tools/viewer/sk_app/WindowContext.cpp
+++ b/tools/viewer/sk_app/WindowContext.cpp
@@ -56,31 +56,4 @@ sk_sp<SkSurface> WindowContext::createSurface(
}
}
-void WindowContext::presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarget> rt,
- int colorBits) {
- if (!this->isGpuContext() || colorBits > 24 ||
- kRGBA_F16_SkColorType == fDisplayParams.fColorType) {
- // We made/have an off-screen surface. Get the contents as an SkImage:
- SkImageInfo info = SkImageInfo::Make(fWidth, fHeight,
- fDisplayParams.fColorType,
- kUnknown_SkAlphaType,
- fDisplayParams.fColorSpace);
- SkBitmap bm;
- bm.allocPixels(info);
- renderSurface->getCanvas()->readPixels(&bm, 0, 0);
- SkPixmap pm;
- bm.peekPixels(&pm);
- sk_sp<SkImage> image(SkImage::MakeTextureFromPixmap(fContext, pm,
- SkBudgeted::kNo));
- GrTexture* texture = as_IB(image)->peekTexture();
- SkASSERT(texture);
-
- // With ten-bit output, we need to manually apply the gamma of the output device
- // (unless we're in non-gamma correct mode, in which case our data is already
- // fake-sRGB, like we're expected to put in the 10-bit buffer):
- bool doGamma = (colorBits == 30) && SkImageInfoIsGammaCorrect(info);
- fContext->applyGamma(rt.get(), texture, doGamma ? 1.0f / 2.2f : 1.0f);
- }
-}
-
} //namespace sk_app
« no previous file with comments | « tools/viewer/sk_app/WindowContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698