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

Unified Diff: tools/viewer/sk_app/VulkanWindowContext.h

Issue 1990893002: Revert of Add OpenGL context to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/GLWindowContext.cpp ('k') | tools/viewer/sk_app/VulkanWindowContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/VulkanWindowContext.h
diff --git a/tools/viewer/sk_app/VulkanWindowContext.h b/tools/viewer/sk_app/VulkanWindowContext.h
index 8480a9efa83f31e94dc483569114173d3002cae2..ec80a3251d2f080c17b6d8dd7c1acf34b922b740 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.h
+++ b/tools/viewer/sk_app/VulkanWindowContext.h
@@ -13,7 +13,8 @@
#include "vk/GrVkBackendContext.h"
#include "WindowContext.h"
-class GrRenderTarget;
+class SkSurface;
+class GrContext;
namespace sk_app {
@@ -34,8 +35,10 @@
return ctx;
}
- sk_sp<SkSurface> getBackbufferSurface() override;
+ SkSurface* getBackbufferSurface() override;
void swapBuffers() override;
+
+ bool makeCurrent() override { return true; }
bool isValid() override { return SkToBool(fBackendContext.get()); }
@@ -43,6 +46,7 @@
this->createSwapchain(w, h, fDisplayParams);
}
+ const DisplayParams& getDisplayParams() override { return fDisplayParams; }
void setDisplayParams(const DisplayParams& params) override {
this->createSwapchain(fWidth, fHeight, params);
}
@@ -95,21 +99,23 @@
VkPtr<PFN_vkQueuePresentKHR> fQueuePresentKHR;
VkPtr<PFN_vkCreateSharedSwapchainsKHR> fCreateSharedSwapchainsKHR;
+ GrContext* fContext;
VkSurfaceKHR fSurface;
VkSwapchainKHR fSwapchain;
uint32_t fPresentQueueIndex;
VkQueue fPresentQueue;
int fWidth;
int fHeight;
+ DisplayParams fDisplayParams;
+ GrPixelConfig fPixelConfig;
- uint32_t fImageCount;
- VkImage* fImages; // images in the swapchain
- VkImageLayout* fImageLayouts; // layouts of these images when not color attachment
- sk_sp<GrRenderTarget>* fRenderTargets; // wrapped rendertargets for those images
- sk_sp<SkSurface>* fSurfaces; // surfaces client renders to (may not be based on rts)
- VkCommandPool fCommandPool;
- BackbufferInfo* fBackbuffers;
- uint32_t fCurrentBackbufferIndex;
+ uint32_t fImageCount;
+ VkImage* fImages; // images in the swapchain
+ VkImageLayout* fImageLayouts; // layouts of these images when not color attachment
+ sk_sp<SkSurface>* fSurfaces; // wrapped surface for those images
+ VkCommandPool fCommandPool;
+ BackbufferInfo* fBackbuffers;
+ uint32_t fCurrentBackbufferIndex;
};
} // namespace sk_app
« no previous file with comments | « tools/viewer/sk_app/GLWindowContext.cpp ('k') | tools/viewer/sk_app/VulkanWindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698