| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkOSWindow_Win_DEFINED | 10 #ifndef SkOSWindow_Win_DEFINED |
| 11 #define SkOSWindow_Win_DEFINED | 11 #define SkOSWindow_Win_DEFINED |
| 12 | 12 |
| 13 #include "../private/SkFunction.h" | |
| 14 #include "../private/SkTHash.h" | 13 #include "../private/SkTHash.h" |
| 15 #include "SkWindow.h" | 14 #include "SkWindow.h" |
| 15 #include <functional> |
| 16 | 16 |
| 17 #if SK_ANGLE | 17 #if SK_ANGLE |
| 18 #include "EGL/egl.h" | 18 #include "EGL/egl.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 #if SK_COMMAND_BUFFER | 21 #if SK_COMMAND_BUFFER |
| 22 class SkCommandBufferGLContext; | 22 class SkCommandBufferGLContext; |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 class SkOSWindow : public SkWindow { | 25 class SkOSWindow : public SkWindow { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void closeWindow(); | 64 void closeWindow(); |
| 65 | 65 |
| 66 static SkOSWindow* GetOSWindowForHWND(void* hwnd) { | 66 static SkOSWindow* GetOSWindowForHWND(void* hwnd) { |
| 67 SkOSWindow** win = gHwndToOSWindowMap.find(hwnd); | 67 SkOSWindow** win = gHwndToOSWindowMap.find(hwnd); |
| 68 if (!win) { | 68 if (!win) { |
| 69 return NULL; | 69 return NULL; |
| 70 } | 70 } |
| 71 return *win; | 71 return *win; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Iterates SkFunction over all the SkOSWindows and their corresponding HWND
s. | 74 // Iterates f over all the SkOSWindows and their corresponding HWNDs. |
| 75 // The void* argument to the SkFunction is a HWND. | 75 // The void* argument to f is a HWND. |
| 76 static void ForAllWindows(const SkFunction<void(void*, SkOSWindow**)>& f) { | 76 static void ForAllWindows(const std::function<void(void*, SkOSWindow**)>& f)
{ |
| 77 gHwndToOSWindowMap.foreach(f); | 77 gHwndToOSWindowMap.foreach(f); |
| 78 } | 78 } |
| 79 | 79 |
| 80 protected: | 80 protected: |
| 81 virtual bool quitOnDeactivate() { return true; } | 81 virtual bool quitOnDeactivate() { return true; } |
| 82 | 82 |
| 83 // overrides from SkWindow | 83 // overrides from SkWindow |
| 84 virtual void onHandleInval(const SkIRect&); | 84 virtual void onHandleInval(const SkIRect&); |
| 85 // overrides from SkView | 85 // overrides from SkView |
| 86 virtual void onAddMenu(const SkOSMenu*); | 86 virtual void onAddMenu(const SkOSMenu*); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 bool attachCommandBuffer(int msaaSampleCount, AttachmentInfo* info); | 140 bool attachCommandBuffer(int msaaSampleCount, AttachmentInfo* info); |
| 141 void detachCommandBuffer(); | 141 void detachCommandBuffer(); |
| 142 void presentCommandBuffer(); | 142 void presentCommandBuffer(); |
| 143 #endif // SK_COMMAND_BUFFER | 143 #endif // SK_COMMAND_BUFFER |
| 144 #endif // SK_SUPPORT_GPU | 144 #endif // SK_SUPPORT_GPU |
| 145 | 145 |
| 146 typedef SkWindow INHERITED; | 146 typedef SkWindow INHERITED; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 #endif | 149 #endif |
| OLD | NEW |