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

Side by Side Diff: tools/vulkan/Window.h

Issue 1873733003: More cleanup in the Vulkan viewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « gm/scaledstrokes.cpp ('k') | tools/vulkan/Window.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef Window_DEFINED 8 #ifndef Window_DEFINED
9 #define Window_DEFINED 9 #define Window_DEFINED
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 class SkCanvas; 13 class SkCanvas;
14 class VulkanTestContext; 14 class VulkanTestContext;
15 15
16 class Window { 16 class Window {
17 public: 17 public:
18 static Window* CreateNativeWindow(void* platformData); 18 static Window* CreateNativeWindow(void* platformData);
19 19
20 virtual ~Window() {}; 20 virtual ~Window() {};
21 21
22 virtual void setTitle(const char*) = 0; 22 virtual void setTitle(const char*) = 0;
23 virtual void show() = 0; 23 virtual void show() = 0;
24 virtual void inval() = 0;
24 25
25 struct AttachmentInfo { 26 struct AttachmentInfo {
26 int fSampleCount; 27 int fSampleCount;
27 int fStencilBits; 28 int fStencilBits;
28 }; 29 };
29 30
30 enum BackEndType { 31 enum BackEndType {
31 kNativeGL_BackendType, 32 kNativeGL_BackendType,
32 kVulkan_BackendType 33 kVulkan_BackendType
33 }; 34 };
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 fPaintFunc = func; 116 fPaintFunc = func;
116 fPaintUserData = userData; 117 fPaintUserData = userData;
117 } 118 }
118 119
119 bool onChar(SkUnichar c, uint32_t modifiers); 120 bool onChar(SkUnichar c, uint32_t modifiers);
120 bool onKey(Key key, InputState state, uint32_t modifiers); 121 bool onKey(Key key, InputState state, uint32_t modifiers);
121 bool onMouse(int x, int y, InputState state, uint32_t modifiers); 122 bool onMouse(int x, int y, InputState state, uint32_t modifiers);
122 void onPaint(); 123 void onPaint();
123 void onResize(uint32_t width, uint32_t height); 124 void onResize(uint32_t width, uint32_t height);
124 125
126 uint32_t width() { return fWidth; }
127 uint32_t height() { return fHeight; }
128
125 protected: 129 protected:
126 Window(); 130 Window();
127 131
132 uint32_t fWidth;
133 uint32_t fHeight;
134
128 OnCharFunc fCharFunc; 135 OnCharFunc fCharFunc;
129 void* fCharUserData; 136 void* fCharUserData;
130 OnKeyFunc fKeyFunc; 137 OnKeyFunc fKeyFunc;
131 void* fKeyUserData; 138 void* fKeyUserData;
132 OnMouseFunc fMouseFunc; 139 OnMouseFunc fMouseFunc;
133 void* fMouseUserData; 140 void* fMouseUserData;
134 OnPaintFunc fPaintFunc; 141 OnPaintFunc fPaintFunc;
135 void* fPaintUserData; 142 void* fPaintUserData;
136 143
137 VulkanTestContext* fTestContext; 144 VulkanTestContext* fTestContext;
138 }; 145 };
139 146
140 147
141 #endif 148 #endif
OLDNEW
« no previous file with comments | « gm/scaledstrokes.cpp ('k') | tools/vulkan/Window.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698