aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer/sk_app
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2016-10-27 16:37:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-28 21:14:17 +0000
commit1f05f44e8fc0d54afdda04c8e2b846ebad5d9d2f (patch)
treecaef452743fa63c904fd8b9aa3ff1b4f910f406b /tools/viewer/sk_app
parent5011f8547c6de936f20bc954d5fd131a52106f33 (diff)
Various fixes in VulkanWindowContext
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4066 Change-Id: Ib42dbe70e868c83bdf06e370388e0cc7639a0992 Reviewed-on: https://skia-review.googlesource.com/4066 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tools/viewer/sk_app')
-rw-r--r--tools/viewer/sk_app/VulkanWindowContext.cpp5
-rw-r--r--tools/viewer/sk_app/VulkanWindowContext.h4
-rw-r--r--tools/viewer/sk_app/WindowContext.cpp5
-rw-r--r--tools/viewer/sk_app/WindowContext.h4
4 files changed, 9 insertions, 9 deletions
diff --git a/tools/viewer/sk_app/VulkanWindowContext.cpp b/tools/viewer/sk_app/VulkanWindowContext.cpp
index 8ce54f0b56..9d1e043097 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.cpp
+++ b/tools/viewer/sk_app/VulkanWindowContext.cpp
@@ -310,7 +310,7 @@ void VulkanWindowContext::createBuffers(VkFormat format) {
fenceInfo.pNext = nullptr;
fenceInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT;
- // we create one additional backbuffer structure here, because we want to
+ // we create one additional backbuffer structure here, because we want to
// give the command buffers they contain a chance to finish before we cycle back
fBackbuffers = new BackbufferInfo[fImageCount + 1];
for (uint32_t i = 0; i < fImageCount + 1; ++i) {
@@ -417,7 +417,6 @@ VulkanWindowContext::BackbufferInfo* VulkanWindowContext::getAvailableBackbuffer
}
BackbufferInfo* backbuffer = fBackbuffers + fCurrentBackbufferIndex;
-
GR_VK_CALL_ERRCHECK(fBackendContext->fInterface,
WaitForFences(fBackendContext->fDevice, 2, backbuffer->fUsageFences,
true, UINT64_MAX));
@@ -444,7 +443,7 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
}
if (VK_ERROR_OUT_OF_DATE_KHR == res) {
// tear swapchain down and try again
- if (!this->createSwapchain(0, 0, fDisplayParams)) {
+ if (!this->createSwapchain(-1, -1, fDisplayParams)) {
return nullptr;
}
diff --git a/tools/viewer/sk_app/VulkanWindowContext.h b/tools/viewer/sk_app/VulkanWindowContext.h
index abb873045f..c1ed871e8e 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.h
+++ b/tools/viewer/sk_app/VulkanWindowContext.h
@@ -36,8 +36,8 @@ public:
this->createSwapchain(fWidth, fHeight, params);
}
- GrBackendContext getBackendContext() override {
- return (GrBackendContext) fBackendContext.get();
+ GrBackendContext getBackendContext() override {
+ return (GrBackendContext) fBackendContext.get();
}
/** Platform specific function that creates a VkSurfaceKHR for a window */
diff --git a/tools/viewer/sk_app/WindowContext.cpp b/tools/viewer/sk_app/WindowContext.cpp
index a39bb20e5b..3da8dd1532 100644
--- a/tools/viewer/sk_app/WindowContext.cpp
+++ b/tools/viewer/sk_app/WindowContext.cpp
@@ -25,12 +25,13 @@ sk_sp<SkSurface> WindowContext::createOffscreenSurface(bool forceSRGB) {
return createSurface(nullptr, 0, true, forceSRGB);
}
-sk_sp<SkSurface> WindowContext::createRenderSurface(GrBackendRenderTargetDesc desc, int colorBits) {
+sk_sp<SkSurface> WindowContext::createRenderSurface(const GrBackendRenderTargetDesc& desc,
+ int colorBits) {
return createSurface(&desc, colorBits, false, false);
}
sk_sp<SkSurface> WindowContext::createSurface(
- GrBackendRenderTargetDesc* rtDesc, int colorBits, bool offscreen, bool forceSRGB) {
+ const GrBackendRenderTargetDesc* rtDesc, int colorBits, bool offscreen, bool forceSRGB) {
if (!this->isGpuContext() || colorBits > 24 || offscreen ||
kRGBA_F16_SkColorType == fDisplayParams.fColorType) {
// If we're rendering to F16, we need an off-screen surface - the current render
diff --git a/tools/viewer/sk_app/WindowContext.h b/tools/viewer/sk_app/WindowContext.h
index 99d693af13..438d3c0e63 100644
--- a/tools/viewer/sk_app/WindowContext.h
+++ b/tools/viewer/sk_app/WindowContext.h
@@ -49,7 +49,7 @@ public:
protected:
virtual bool isGpuContext() { return true; }
- sk_sp<SkSurface> createRenderSurface(GrBackendRenderTargetDesc, int colorBits);
+ sk_sp<SkSurface> createRenderSurface(const GrBackendRenderTargetDesc&, int colorBits);
GrContext* fContext;
@@ -61,7 +61,7 @@ protected:
private:
sk_sp<SkSurface> createSurface(
- GrBackendRenderTargetDesc*, int colorBits, bool offscreen, bool forceSRGB);
+ const GrBackendRenderTargetDesc*, int colorBits, bool offscreen, bool forceSRGB);
};
} // namespace sk_app