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_DRI_DRI_SURFACE_FACTORY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "ui/ozone/platform/dri/hardware_cursor_delegate.h" | 12 #include "ui/ozone/platform/dri/hardware_cursor_delegate.h" |
13 #include "ui/ozone/public/surface_factory_ozone.h" | 13 #include "ui/ozone/public/surface_factory_ozone.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 | 16 |
17 class DriSurface; | 17 class DriBuffer; |
18 class DriWrapper; | 18 class DriWrapper; |
19 class HardwareDisplayController; | 19 class HardwareDisplayController; |
20 class ScreenManager; | 20 class ScreenManager; |
21 class SurfaceOzoneCanvas; | 21 class SurfaceOzoneCanvas; |
22 | 22 |
23 // SurfaceFactoryOzone implementation on top of DRM/KMS using dumb buffers. | 23 // SurfaceFactoryOzone implementation on top of DRM/KMS using dumb buffers. |
24 // This implementation is used in conjunction with the software rendering | 24 // This implementation is used in conjunction with the software rendering |
25 // path. | 25 // path. |
26 class DriSurfaceFactory : public ui::SurfaceFactoryOzone, | 26 class DriSurfaceFactory : public ui::SurfaceFactoryOzone, |
27 public HardwareCursorDelegate { | 27 public HardwareCursorDelegate { |
(...skipping 22 matching lines...) Expand all Loading... |
50 virtual void SetHardwareCursor(gfx::AcceleratedWidget window, | 50 virtual void SetHardwareCursor(gfx::AcceleratedWidget window, |
51 const SkBitmap& image, | 51 const SkBitmap& image, |
52 const gfx::Point& location) OVERRIDE; | 52 const gfx::Point& location) OVERRIDE; |
53 virtual void MoveHardwareCursor(gfx::AcceleratedWidget window, | 53 virtual void MoveHardwareCursor(gfx::AcceleratedWidget window, |
54 const gfx::Point& location) OVERRIDE; | 54 const gfx::Point& location) OVERRIDE; |
55 | 55 |
56 protected: | 56 protected: |
57 // Draw the last set cursor & update the cursor plane. | 57 // Draw the last set cursor & update the cursor plane. |
58 void ResetCursor(gfx::AcceleratedWidget w); | 58 void ResetCursor(gfx::AcceleratedWidget w); |
59 | 59 |
60 virtual DriSurface* CreateSurface(const gfx::Size& size); | |
61 | |
62 DriWrapper* drm_; // Not owned. | 60 DriWrapper* drm_; // Not owned. |
63 ScreenManager* screen_manager_; // Not owned. | 61 ScreenManager* screen_manager_; // Not owned. |
64 HardwareState state_; | 62 HardwareState state_; |
65 | 63 |
66 // Active outputs. | 64 // Active outputs. |
67 int allocated_widgets_; | 65 int allocated_widgets_; |
68 | 66 |
69 scoped_ptr<DriSurface> cursor_surface_; | 67 scoped_refptr<DriBuffer> cursor_buffers_[2]; |
| 68 int cursor_frontbuffer_; |
70 | 69 |
71 SkBitmap cursor_bitmap_; | 70 SkBitmap cursor_bitmap_; |
72 gfx::Point cursor_location_; | 71 gfx::Point cursor_location_; |
73 | 72 |
74 DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory); | 73 DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory); |
75 }; | 74 }; |
76 | 75 |
77 } // namespace ui | 76 } // namespace ui |
78 | 77 |
79 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ | 78 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
OLD | NEW |