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 #include "ui/gfx/vsync_provider.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 | 13 |
14 // static | 14 // static |
15 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; | 15 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; |
16 | 16 |
17 class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone { | |
18 public: | |
19 SurfaceFactoryOzoneStub() {} | |
20 virtual ~SurfaceFactoryOzoneStub() {} | |
21 | |
22 virtual HardwareState InitializeHardware() OVERRIDE { return INITIALIZED; } | |
23 virtual void ShutdownHardware() OVERRIDE {} | |
24 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 0; } | |
25 virtual gfx::AcceleratedWidget RealizeAcceleratedWidget( | |
26 gfx::AcceleratedWidget w) OVERRIDE { | |
27 return 0; | |
28 } | |
29 virtual bool LoadEGLGLES2Bindings( | |
30 AddGLLibraryCallback add_gl_library, | |
31 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE { | |
32 return true; | |
33 } | |
34 virtual bool AttemptToResizeAcceleratedWidget( | |
35 gfx::AcceleratedWidget w, | |
36 const gfx::Rect& bounds) OVERRIDE { | |
37 return false; | |
38 } | |
39 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider( | |
40 gfx::AcceleratedWidget w) OVERRIDE { | |
41 return scoped_ptr<VSyncProvider>(); | |
42 } | |
43 }; | |
44 | |
45 SurfaceFactoryOzone::SurfaceFactoryOzone() { | 17 SurfaceFactoryOzone::SurfaceFactoryOzone() { |
46 } | 18 } |
47 | 19 |
48 SurfaceFactoryOzone::~SurfaceFactoryOzone() { | 20 SurfaceFactoryOzone::~SurfaceFactoryOzone() { |
49 } | 21 } |
50 | 22 |
51 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { | 23 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { |
52 CHECK(impl_) << "No SurfaceFactoryOzone implementation set."; | 24 CHECK(impl_) << "No SurfaceFactoryOzone implementation set."; |
53 return impl_; | 25 return impl_; |
54 } | 26 } |
(...skipping 23 matching lines...) Expand all Loading... |
78 | 50 |
79 SkCanvas* SurfaceFactoryOzone::GetCanvasForWidget(gfx::AcceleratedWidget w) { | 51 SkCanvas* SurfaceFactoryOzone::GetCanvasForWidget(gfx::AcceleratedWidget w) { |
80 return NULL; | 52 return NULL; |
81 } | 53 } |
82 | 54 |
83 const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties( | 55 const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties( |
84 const int32* desired_attributes) { | 56 const int32* desired_attributes) { |
85 return desired_attributes; | 57 return desired_attributes; |
86 } | 58 } |
87 | 59 |
88 // static | |
89 SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() { | |
90 return new SurfaceFactoryOzoneStub; | |
91 } | |
92 | |
93 } // namespace gfx | 60 } // namespace gfx |
OLD | NEW |