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 <EGL/egl.h> | 7 #include <EGL/egl.h> |
8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 previous_frame_overlay_count_ = overlay_count_; | 160 previous_frame_overlay_count_ = overlay_count_; |
161 previous_frame_overlay_bounds_ = overlay_bounds_; | 161 previous_frame_overlay_bounds_ = overlay_bounds_; |
162 overlay_count_ = 0; | 162 overlay_count_ = 0; |
163 } | 163 } |
164 | 164 |
165 void SurfaceFactoryCast::OnOverlayScheduled(const gfx::Rect& display_bounds) { | 165 void SurfaceFactoryCast::OnOverlayScheduled(const gfx::Rect& display_bounds) { |
166 ++overlay_count_; | 166 ++overlay_count_; |
167 overlay_bounds_ = display_bounds; | 167 overlay_bounds_ = display_bounds; |
168 } | 168 } |
169 | 169 |
170 bool SurfaceFactoryCast::UseNewSurfaceAPI() { | |
171 return true; | |
172 } | |
173 | |
174 scoped_refptr<gl::GLSurface> SurfaceFactoryCast::CreateViewGLSurface( | 170 scoped_refptr<gl::GLSurface> SurfaceFactoryCast::CreateViewGLSurface( |
175 gl::GLImplementation implementation, | 171 gl::GLImplementation implementation, |
176 gfx::AcceleratedWidget widget) { | 172 gfx::AcceleratedWidget widget) { |
177 if (implementation != gl::kGLImplementationEGLGLES2) { | 173 if (implementation != gl::kGLImplementationEGLGLES2) { |
178 NOTREACHED(); | 174 NOTREACHED(); |
179 return nullptr; | 175 return nullptr; |
180 } | 176 } |
181 | 177 |
182 // Verify requested widget dimensions match our current display size. | 178 // Verify requested widget dimensions match our current display size. |
183 DCHECK_EQ(widget >> 16, display_size_.width()); | 179 DCHECK_EQ(widget >> 16, display_size_.width()); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 return false; | 325 return false; |
330 } | 326 } |
331 | 327 |
332 set_gl_get_proc_address.Run(gl_proc); | 328 set_gl_get_proc_address.Run(gl_proc); |
333 add_gl_library.Run(lib_egl); | 329 add_gl_library.Run(lib_egl); |
334 add_gl_library.Run(lib_gles2); | 330 add_gl_library.Run(lib_gles2); |
335 return true; | 331 return true; |
336 } | 332 } |
337 | 333 |
338 } // namespace ui | 334 } // namespace ui |
OLD | NEW |