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

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

Issue 1950983007: Add sRGB mode toggle to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Bundle window surface parameters in struct, use SkColorType/SkColorProfileType 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/DisplayParams.h ('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 48f8ed536ba12a183c786abbd003678c2cb06141..e1868815655bfbc6f7caade1136066cd6a0185a1 100644
--- a/tools/viewer/sk_app/VulkanWindowContext.h
+++ b/tools/viewer/sk_app/VulkanWindowContext.h
@@ -26,8 +26,8 @@ public:
static VkSurfaceKHR createVkSurface(VkInstance, void* platformData);
static bool canPresent(VkInstance, VkPhysicalDevice, uint32_t queueFamilyIndex);
- static VulkanWindowContext* Create(void* platformData, int msaaSampleCount) {
- VulkanWindowContext* ctx = new VulkanWindowContext(platformData, msaaSampleCount);
+ static VulkanWindowContext* Create(void* platformData, const DisplayParams& params) {
+ VulkanWindowContext* ctx = new VulkanWindowContext(platformData, params);
if (!ctx->isValid()) {
delete ctx;
return nullptr;
@@ -43,7 +43,12 @@ public:
bool isValid() override { return SkToBool(fBackendContext.get()); }
void resize(uint32_t w, uint32_t h) override {
- this->createSwapchain(w, h);
+ this->createSwapchain(w, h, fDisplayParams);
+ }
+
+ const DisplayParams& getDisplayParams() { return fDisplayParams; }
+ void setDisplayParams(const DisplayParams& params) {
+ this->createSwapchain(fWidth, fHeight, params);
}
GrBackendContext getBackendContext() override {
@@ -51,9 +56,8 @@ public:
}
private:
- VulkanWindowContext();
- VulkanWindowContext(void*, int msaaSampleCount);
- void initializeContext(void*);
+ VulkanWindowContext(void*, const DisplayParams&);
+ void initializeContext(void*, const DisplayParams&);
void destroyContext();
struct BackbufferInfo {
@@ -65,7 +69,7 @@ private:
};
BackbufferInfo* getAvailableBackbuffer();
- bool createSwapchain(uint32_t width, uint32_t height);
+ bool createSwapchain(uint32_t width, uint32_t height, const DisplayParams& params);
void createBuffers(VkFormat format);
void destroyBuffers();
@@ -102,6 +106,7 @@ private:
VkQueue fPresentQueue;
int fWidth;
int fHeight;
+ DisplayParams fDisplayParams;
GrPixelConfig fPixelConfig;
uint32_t fImageCount;
« no previous file with comments | « tools/viewer/sk_app/DisplayParams.h ('k') | tools/viewer/sk_app/VulkanWindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698