OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "ui/base/ozone/surface_factory_ozone.h" | 5 #include "ui/base/ozone/surface_factory_ozone.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
11 // static | 11 // static |
12 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; | 12 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; |
13 | 13 |
14 class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone { | 14 class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone { |
15 public: | 15 public: |
16 SurfaceFactoryOzoneStub() {} | 16 SurfaceFactoryOzoneStub() {} |
17 virtual ~SurfaceFactoryOzoneStub() {} | 17 virtual ~SurfaceFactoryOzoneStub() {} |
18 | 18 |
19 virtual void InitializeHardware() OVERRIDE {} | 19 virtual bool InitializeHardware() OVERRIDE { return true; } |
20 virtual void ShutdownHardware() OVERRIDE {} | 20 virtual void ShutdownHardware() OVERRIDE {} |
| 21 virtual EGLNativeDisplayType GetNativeDisplay() OVERRIDE { return 0; } |
21 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 0; } | 22 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 0; } |
22 virtual gfx::AcceleratedWidget RealizeAcceleratedWidget( | 23 virtual gfx::AcceleratedWidget RealizeAcceleratedWidget( |
23 gfx::AcceleratedWidget w) OVERRIDE { | 24 gfx::AcceleratedWidget w) OVERRIDE { |
24 return 0; | 25 return 0; |
25 } | 26 } |
26 virtual bool LoadEGLGLES2Bindings() OVERRIDE { return true; } | 27 virtual bool LoadEGLGLES2Bindings() OVERRIDE { return true; } |
27 virtual bool AttemptToResizeAcceleratedWidget( | 28 virtual bool AttemptToResizeAcceleratedWidget( |
28 gfx::AcceleratedWidget w, | 29 gfx::AcceleratedWidget w, |
29 const gfx::Rect& bounds) OVERRIDE { | 30 const gfx::Rect& bounds) OVERRIDE { |
30 return false; | 31 return false; |
31 } | 32 } |
| 33 virtual bool SwapBuffers() OVERRIDE { return true; } |
32 virtual gfx::VSyncProvider* GetVSyncProvider( | 34 virtual gfx::VSyncProvider* GetVSyncProvider( |
33 gfx::AcceleratedWidget w) OVERRIDE { | 35 gfx::AcceleratedWidget w) OVERRIDE { |
34 return NULL; | 36 return NULL; |
35 } | 37 } |
| 38 virtual void Paint(const SkBitmap& bitmap, const gfx::Rect& rect) OVERRIDE {} |
36 }; | 39 }; |
37 | 40 |
38 SurfaceFactoryOzone::SurfaceFactoryOzone() { | 41 SurfaceFactoryOzone::SurfaceFactoryOzone() { |
39 } | 42 } |
40 | 43 |
41 SurfaceFactoryOzone::~SurfaceFactoryOzone() { | 44 SurfaceFactoryOzone::~SurfaceFactoryOzone() { |
42 } | 45 } |
43 | 46 |
44 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { | 47 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { |
45 CHECK(impl_) << "SurfaceFactoryOzone accessed before constructed"; | 48 CHECK(impl_) << "SurfaceFactoryOzone accessed before constructed"; |
(...skipping 14 matching lines...) Expand all Loading... |
60 gfx::Screen* SurfaceFactoryOzone::CreateDesktopScreen() { | 63 gfx::Screen* SurfaceFactoryOzone::CreateDesktopScreen() { |
61 return NULL; | 64 return NULL; |
62 } | 65 } |
63 | 66 |
64 // static | 67 // static |
65 SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() { | 68 SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() { |
66 return new SurfaceFactoryOzoneStub; | 69 return new SurfaceFactoryOzoneStub; |
67 } | 70 } |
68 | 71 |
69 } // namespace ui | 72 } // namespace ui |
OLD | NEW |