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

Unified Diff: include/views/SkOSWindow_Win.h

Issue 1187643002: VisualBench on windows (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 6 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 | « no previous file | src/views/win/SkOSWindow_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/views/SkOSWindow_Win.h
diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h
index fe65459f4deb4fb46c260eb562a497b79ca6a30d..7a0cb7c0fdd86b9c2416807c3991f9532dd967d6 100644
--- a/include/views/SkOSWindow_Win.h
+++ b/include/views/SkOSWindow_Win.h
@@ -11,6 +11,8 @@
#define SkOSWindow_Win_DEFINED
#include "SkWindow.h"
+#include "../../src/core/SkFunction.h"
+#include "../../src/core/SkTHash.h"
#if SK_ANGLE
#include "EGL/egl.h"
@@ -18,12 +20,13 @@
class SkOSWindow : public SkWindow {
public:
- SkOSWindow(void* hwnd);
- virtual ~SkOSWindow();
+ struct WindowInit {
+ TCHAR* fClass;
+ HINSTANCE fInstance;
+ };
- void* getHWND() const { return fHWND; }
- void setSize(int width, int height);
- void updateSize();
+ SkOSWindow(const void* winInit);
+ virtual ~SkOSWindow();
static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay);
@@ -49,6 +52,24 @@ public:
SK_WM_SkTimerID = 0xFFFF // just need a non-zero value
};
+ void setFullscreen(bool) override;
+ void setVsync(bool) override;
+ void closeWindow() override;
+
+ static SkOSWindow* GetOSWindowForHWND(void* hwnd) {
+ SkOSWindow** win = gHwndToOSWindowMap.find(hwnd);
+ if (!win) {
+ return NULL;
+ }
+ return *win;
+ }
+
+ // Iterates SkFunction over all the SkOSWindows and their corresponding HWNDs.
+ // The void* argument to the SkFunction is a HWND.
+ static void ForAllWindows(const SkFunction<void(void*, SkOSWindow**)>& f) {
+ gHwndToOSWindowMap.foreach(f);
+ }
+
protected:
virtual bool quitOnDeactivate() { return true; }
@@ -60,6 +81,9 @@ protected:
virtual void onSetTitle(const char title[]);
private:
+ static SkTHashMap<void*, SkOSWindow*> gHwndToOSWindowMap;
+
+ WindowInit fWinInit;
void* fHWND;
void doPaint(void* ctx);
@@ -74,10 +98,23 @@ private:
#endif // SK_ANGLE
#endif // SK_SUPPORT_GPU
+ bool fFullscreen;
+ struct SavedWindowState {
+ bool fZoomed;
+ LONG fStyle;
+ LONG fExStyle;
+ RECT fRect;
+ LONG fScreenWidth;
+ LONG fScreenHeight;
+ LONG fScreenBits;
+ void* fHWND;
+ } fSavedWindowState;
+
HMENU fMBar;
SkBackEndTypes fAttached;
+ void updateSize();
#if SK_SUPPORT_GPU
bool attachGL(int msaaSampleCount, AttachmentInfo* info);
void detachGL();
« no previous file with comments | « no previous file | src/views/win/SkOSWindow_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698