| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_ |
| 6 #define UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/id_map.h" | 12 #include "base/id_map.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 14 #include "ui/ozone/public/surface_factory_ozone.h" | 15 #include "ui/ozone/public/surface_factory_ozone.h" |
| 15 | 16 |
| 16 namespace gfx { | 17 namespace gfx { |
| 17 class Rect; | 18 class Rect; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace ui { | 21 namespace ui { |
| 21 | 22 |
| 22 class CacaWindow; | 23 class CacaWindow; |
| 23 | 24 |
| 24 class CacaWindowManager : public SurfaceFactoryOzone { | 25 class CacaWindowManager : public SurfaceFactoryOzone { |
| 25 public: | 26 public: |
| 26 CacaWindowManager(); | 27 CacaWindowManager(); |
| 27 ~CacaWindowManager() override; | 28 ~CacaWindowManager() override; |
| 28 | 29 |
| 29 // Register a new libcaca window/instance. Returns the window id. | 30 // Register a new libcaca window/instance. Returns the window id. |
| 30 int32_t AddWindow(CacaWindow* window); | 31 int32_t AddWindow(CacaWindow* window); |
| 31 | 32 |
| 32 // Remove a libcaca window/instance. | 33 // Remove a libcaca window/instance. |
| 33 void RemoveWindow(int32_t window_id, CacaWindow* window); | 34 void RemoveWindow(int32_t window_id, CacaWindow* window); |
| 34 | 35 |
| 35 // ui::SurfaceFactoryOzone overrides: | 36 // ui::SurfaceFactoryOzone overrides: |
| 36 bool LoadEGLGLES2Bindings( | 37 bool LoadEGLGLES2Bindings( |
| 37 AddGLLibraryCallback add_gl_library, | 38 AddGLLibraryCallback add_gl_library, |
| 38 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; | 39 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; |
| 39 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( | 40 std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( |
| 40 gfx::AcceleratedWidget widget) override; | 41 gfx::AcceleratedWidget widget) override; |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 IDMap<CacaWindow> windows_; | 44 IDMap<CacaWindow> windows_; |
| 44 base::ThreadChecker thread_checker_; | 45 base::ThreadChecker thread_checker_; |
| 45 | 46 |
| 46 DISALLOW_COPY_AND_ASSIGN(CacaWindowManager); | 47 DISALLOW_COPY_AND_ASSIGN(CacaWindowManager); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace ui | 50 } // namespace ui |
| 50 | 51 |
| 51 #endif // UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_ | 52 #endif // UI_OZONE_PLATFORM_CACA_CACA_WINDOW_MANAGER_H_ |
| OLD | NEW |