aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-07-28 08:53:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-28 08:53:13 -0700
commit1c58696112a5d7bf1acbcc337099b0bf5eb80650 (patch)
treed24f591337647858d5b92a27e318ad83edf32af5
parentb4021cfd6630dccc95ee1d4124cad41c79103129 (diff)
Remove unused sk_app::WindowContext::presentRenderSurface
-rw-r--r--tools/viewer/sk_app/GLWindowContext.cpp1
-rw-r--r--tools/viewer/sk_app/VulkanWindowContext.cpp3
-rwxr-xr-xtools/viewer/sk_app/WindowContext.cpp27
-rw-r--r--tools/viewer/sk_app/WindowContext.h2
4 files changed, 0 insertions, 33 deletions
diff --git a/tools/viewer/sk_app/GLWindowContext.cpp b/tools/viewer/sk_app/GLWindowContext.cpp
index 2a5761caf4..74454e9324 100644
--- a/tools/viewer/sk_app/GLWindowContext.cpp
+++ b/tools/viewer/sk_app/GLWindowContext.cpp
@@ -89,7 +89,6 @@ sk_sp<SkSurface> GLWindowContext::getBackbufferSurface() {
}
void GLWindowContext::swapBuffers() {
- this->presentRenderSurface(fSurface, fRenderTarget, fActualColorBits);
this->onSwapBuffers();
}
diff --git a/tools/viewer/sk_app/VulkanWindowContext.cpp b/tools/viewer/sk_app/VulkanWindowContext.cpp
index f2fc1e57a8..7647bd8ccd 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.cpp
+++ b/tools/viewer/sk_app/VulkanWindowContext.cpp
@@ -524,9 +524,6 @@ void VulkanWindowContext::swapBuffers() {
BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex;
- this->presentRenderSurface(fSurfaces[backbuffer->fImageIndex],
- fRenderTargets[backbuffer->fImageIndex], 24);
-
VkImageLayout layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
VkPipelineStageFlags srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
diff --git a/tools/viewer/sk_app/WindowContext.cpp b/tools/viewer/sk_app/WindowContext.cpp
index 458f66a67b..b5039a3970 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
diff --git a/tools/viewer/sk_app/WindowContext.h b/tools/viewer/sk_app/WindowContext.h
index f63009c349..99d693af13 100644
--- a/tools/viewer/sk_app/WindowContext.h
+++ b/tools/viewer/sk_app/WindowContext.h
@@ -45,8 +45,6 @@ public:
GrContext* getGrContext() const { return fContext; }
sk_sp<SkSurface> createOffscreenSurface(bool sRGB);
- void presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarget> rt,
- int colorBits);
protected:
virtual bool isGpuContext() { return true; }