OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ozone/platform/cast/surface_factory_cast.h" | 5 #include "ui/ozone/platform/cast/surface_factory_cast.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <EGL/egl.h> | 8 #include <EGL/egl.h> |
| 9 #include <utility> |
9 | 10 |
10 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
11 #include "chromecast/public/cast_egl_platform.h" | 12 #include "chromecast/public/cast_egl_platform.h" |
12 #include "chromecast/public/graphics_types.h" | 13 #include "chromecast/public/graphics_types.h" |
13 #include "third_party/skia/include/core/SkSurface.h" | 14 #include "third_party/skia/include/core/SkSurface.h" |
14 #include "ui/gfx/geometry/quad_f.h" | 15 #include "ui/gfx/geometry/quad_f.h" |
15 #include "ui/gfx/vsync_provider.h" | 16 #include "ui/gfx/vsync_provider.h" |
16 #include "ui/ozone/platform/cast/surface_ozone_egl_cast.h" | 17 #include "ui/ozone/platform/cast/surface_ozone_egl_cast.h" |
17 #include "ui/ozone/public/native_pixmap.h" | 18 #include "ui/ozone/public/native_pixmap.h" |
18 #include "ui/ozone/public/surface_ozone_canvas.h" | 19 #include "ui/ozone/public/surface_ozone_canvas.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 70 |
70 SurfaceFactoryCast::SurfaceFactoryCast() : SurfaceFactoryCast(nullptr) {} | 71 SurfaceFactoryCast::SurfaceFactoryCast() : SurfaceFactoryCast(nullptr) {} |
71 | 72 |
72 SurfaceFactoryCast::SurfaceFactoryCast(scoped_ptr<CastEglPlatform> egl_platform) | 73 SurfaceFactoryCast::SurfaceFactoryCast(scoped_ptr<CastEglPlatform> egl_platform) |
73 : state_(kUninitialized), | 74 : state_(kUninitialized), |
74 display_type_(0), | 75 display_type_(0), |
75 have_display_type_(false), | 76 have_display_type_(false), |
76 window_(0), | 77 window_(0), |
77 display_size_(GetInitialDisplaySize()), | 78 display_size_(GetInitialDisplaySize()), |
78 new_display_size_(GetInitialDisplaySize()), | 79 new_display_size_(GetInitialDisplaySize()), |
79 egl_platform_(egl_platform.Pass()) { | 80 egl_platform_(std::move(egl_platform)) {} |
80 } | |
81 | 81 |
82 SurfaceFactoryCast::~SurfaceFactoryCast() { | 82 SurfaceFactoryCast::~SurfaceFactoryCast() { |
83 ShutdownHardware(); | 83 ShutdownHardware(); |
84 } | 84 } |
85 | 85 |
86 void SurfaceFactoryCast::InitializeHardware() { | 86 void SurfaceFactoryCast::InitializeHardware() { |
87 if (state_ == kInitialized) { | 87 if (state_ == kInitialized) { |
88 return; | 88 return; |
89 } | 89 } |
90 CHECK_EQ(state_, kUninitialized); | 90 CHECK_EQ(state_, kUninitialized); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 return false; | 277 return false; |
278 } | 278 } |
279 | 279 |
280 set_gl_get_proc_address.Run(gl_proc); | 280 set_gl_get_proc_address.Run(gl_proc); |
281 add_gl_library.Run(lib_egl); | 281 add_gl_library.Run(lib_egl); |
282 add_gl_library.Run(lib_gles2); | 282 add_gl_library.Run(lib_gles2); |
283 return true; | 283 return true; |
284 } | 284 } |
285 | 285 |
286 } // namespace ui | 286 } // namespace ui |
OLD | NEW |