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/gfx/ozone/surface_factory_ozone.h" | 5 #include "ui/gfx/ozone/surface_factory_ozone.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "ui/gfx/vsync_provider.h" |
10 | 11 |
11 namespace gfx { | 12 namespace gfx { |
12 | 13 |
13 // static | 14 // static |
14 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; | 15 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; |
15 | 16 |
16 class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone { | 17 class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone { |
17 public: | 18 public: |
18 SurfaceFactoryOzoneStub() {} | 19 SurfaceFactoryOzoneStub() {} |
19 virtual ~SurfaceFactoryOzoneStub() {} | 20 virtual ~SurfaceFactoryOzoneStub() {} |
20 | 21 |
21 virtual HardwareState InitializeHardware() OVERRIDE { return INITIALIZED; } | 22 virtual HardwareState InitializeHardware() OVERRIDE { return INITIALIZED; } |
22 virtual void ShutdownHardware() OVERRIDE {} | 23 virtual void ShutdownHardware() OVERRIDE {} |
23 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 0; } | 24 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 0; } |
24 virtual gfx::AcceleratedWidget RealizeAcceleratedWidget( | 25 virtual gfx::AcceleratedWidget RealizeAcceleratedWidget( |
25 gfx::AcceleratedWidget w) OVERRIDE { | 26 gfx::AcceleratedWidget w) OVERRIDE { |
26 return 0; | 27 return 0; |
27 } | 28 } |
28 virtual bool LoadEGLGLES2Bindings( | 29 virtual bool LoadEGLGLES2Bindings( |
29 AddGLLibraryCallback add_gl_library, | 30 AddGLLibraryCallback add_gl_library, |
30 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE { | 31 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE { |
31 return true; | 32 return true; |
32 } | 33 } |
33 virtual bool AttemptToResizeAcceleratedWidget( | 34 virtual bool AttemptToResizeAcceleratedWidget( |
34 gfx::AcceleratedWidget w, | 35 gfx::AcceleratedWidget w, |
35 const gfx::Rect& bounds) OVERRIDE { | 36 const gfx::Rect& bounds) OVERRIDE { |
36 return false; | 37 return false; |
37 } | 38 } |
38 virtual gfx::VSyncProvider* GetVSyncProvider( | 39 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider( |
39 gfx::AcceleratedWidget w) OVERRIDE { | 40 gfx::AcceleratedWidget w) OVERRIDE { |
40 return NULL; | 41 return scoped_ptr<VSyncProvider>(); |
41 } | 42 } |
42 }; | 43 }; |
43 | 44 |
44 SurfaceFactoryOzone::SurfaceFactoryOzone() { | 45 SurfaceFactoryOzone::SurfaceFactoryOzone() { |
45 } | 46 } |
46 | 47 |
47 SurfaceFactoryOzone::~SurfaceFactoryOzone() { | 48 SurfaceFactoryOzone::~SurfaceFactoryOzone() { |
48 } | 49 } |
49 | 50 |
50 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { | 51 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const int32* desired_attributes) { | 84 const int32* desired_attributes) { |
84 return desired_attributes; | 85 return desired_attributes; |
85 } | 86 } |
86 | 87 |
87 // static | 88 // static |
88 SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() { | 89 SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() { |
89 return new SurfaceFactoryOzoneStub; | 90 return new SurfaceFactoryOzoneStub; |
90 } | 91 } |
91 | 92 |
92 } // namespace gfx | 93 } // namespace gfx |
OLD | NEW |