OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gl/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 InitializeDebugGLBindings(); | 89 InitializeDebugGLBindings(); |
90 if (disable_gl_drawing) | 90 if (disable_gl_drawing) |
91 InitializeNullDrawGLBindings(); | 91 InitializeNullDrawGLBindings(); |
92 } | 92 } |
93 return initialized; | 93 return initialized; |
94 } | 94 } |
95 | 95 |
96 GLSurface::GLSurface() {} | 96 GLSurface::GLSurface() {} |
97 | 97 |
98 bool GLSurface::Initialize() { | 98 bool GLSurface::Initialize() { |
99 return Initialize(SURFACE_DEFAULT); | 99 return Initialize(GetDefaultFormat()); |
100 } | 100 } |
101 | 101 |
102 bool GLSurface::Initialize(GLSurface::Format format) { | 102 bool GLSurface::Initialize(GLSurface::Format format) { |
| 103 format_ = format; |
103 return true; | 104 return true; |
104 } | 105 } |
105 | 106 |
106 bool GLSurface::Resize(const gfx::Size& size, | 107 bool GLSurface::Resize(const gfx::Size& size, |
107 float scale_factor, | 108 float scale_factor, |
108 bool has_alpha) { | 109 bool has_alpha) { |
109 NOTIMPLEMENTED(); | 110 NOTIMPLEMENTED(); |
110 return false; | 111 return false; |
111 } | 112 } |
112 | 113 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 void* GLSurface::GetDisplay() { | 184 void* GLSurface::GetDisplay() { |
184 NOTIMPLEMENTED(); | 185 NOTIMPLEMENTED(); |
185 return NULL; | 186 return NULL; |
186 } | 187 } |
187 | 188 |
188 void* GLSurface::GetConfig() { | 189 void* GLSurface::GetConfig() { |
189 NOTIMPLEMENTED(); | 190 NOTIMPLEMENTED(); |
190 return NULL; | 191 return NULL; |
191 } | 192 } |
192 | 193 |
193 unsigned GLSurface::GetFormat() { | 194 GLSurface::Format GLSurface::GetDefaultFormat() const { |
194 NOTIMPLEMENTED(); | 195 return SURFACE_DEFAULT; |
195 return 0; | 196 } |
| 197 |
| 198 GLSurface::Format GLSurface::GetFormat() { |
| 199 return format_; |
196 } | 200 } |
197 | 201 |
198 VSyncProvider* GLSurface::GetVSyncProvider() { | 202 VSyncProvider* GLSurface::GetVSyncProvider() { |
199 return NULL; | 203 return NULL; |
200 } | 204 } |
201 | 205 |
202 bool GLSurface::ScheduleOverlayPlane(int z_order, | 206 bool GLSurface::ScheduleOverlayPlane(int z_order, |
203 OverlayTransform transform, | 207 OverlayTransform transform, |
204 gl::GLImage* image, | 208 gl::GLImage* image, |
205 const Rect& bounds_rect, | 209 const Rect& bounds_rect, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 370 } |
367 | 371 |
368 void* GLSurfaceAdapter::GetDisplay() { | 372 void* GLSurfaceAdapter::GetDisplay() { |
369 return surface_->GetDisplay(); | 373 return surface_->GetDisplay(); |
370 } | 374 } |
371 | 375 |
372 void* GLSurfaceAdapter::GetConfig() { | 376 void* GLSurfaceAdapter::GetConfig() { |
373 return surface_->GetConfig(); | 377 return surface_->GetConfig(); |
374 } | 378 } |
375 | 379 |
376 unsigned GLSurfaceAdapter::GetFormat() { | 380 GLSurface::Format GLSurfaceAdapter::GetFormat() { |
377 return surface_->GetFormat(); | 381 return surface_->GetFormat(); |
378 } | 382 } |
379 | 383 |
380 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { | 384 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { |
381 return surface_->GetVSyncProvider(); | 385 return surface_->GetVSyncProvider(); |
382 } | 386 } |
383 | 387 |
384 bool GLSurfaceAdapter::ScheduleOverlayPlane(int z_order, | 388 bool GLSurfaceAdapter::ScheduleOverlayPlane(int z_order, |
385 OverlayTransform transform, | 389 OverlayTransform transform, |
386 gl::GLImage* image, | 390 gl::GLImage* image, |
(...skipping 11 matching lines...) Expand all Loading... |
398 return surface_->FlipsVertically(); | 402 return surface_->FlipsVertically(); |
399 } | 403 } |
400 | 404 |
401 bool GLSurfaceAdapter::BuffersFlipped() const { | 405 bool GLSurfaceAdapter::BuffersFlipped() const { |
402 return surface_->BuffersFlipped(); | 406 return surface_->BuffersFlipped(); |
403 } | 407 } |
404 | 408 |
405 GLSurfaceAdapter::~GLSurfaceAdapter() {} | 409 GLSurfaceAdapter::~GLSurfaceAdapter() {} |
406 | 410 |
407 } // namespace gfx | 411 } // namespace gfx |
OLD | NEW |