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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/threading/thread_local.h" | 13 #include "base/threading/thread_local.h" |
14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
15 #include "ui/gfx/swap_result.h" | 15 #include "ui/gfx/swap_result.h" |
16 #include "ui/gl/gl_context.h" | 16 #include "ui/gl/gl_context.h" |
17 #include "ui/gl/gl_implementation.h" | 17 #include "ui/gl/gl_implementation.h" |
18 #include "ui/gl/gl_switches.h" | 18 #include "ui/gl/gl_switches.h" |
19 | 19 |
20 namespace gfx { | 20 namespace gl { |
21 | 21 |
22 namespace { | 22 namespace { |
23 base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leaky | 23 base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leaky |
24 current_surface_ = LAZY_INSTANCE_INITIALIZER; | 24 current_surface_ = LAZY_INSTANCE_INITIALIZER; |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 // static | 27 // static |
28 bool GLSurface::InitializeOneOff() { | 28 bool GLSurface::InitializeOneOff() { |
29 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); | 29 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
30 | 30 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void* GLSurface::GetConfig() { | 185 void* GLSurface::GetConfig() { |
186 NOTIMPLEMENTED(); | 186 NOTIMPLEMENTED(); |
187 return NULL; | 187 return NULL; |
188 } | 188 } |
189 | 189 |
190 GLSurface::Format GLSurface::GetFormat() { | 190 GLSurface::Format GLSurface::GetFormat() { |
191 NOTIMPLEMENTED(); | 191 NOTIMPLEMENTED(); |
192 return SURFACE_DEFAULT; | 192 return SURFACE_DEFAULT; |
193 } | 193 } |
194 | 194 |
195 VSyncProvider* GLSurface::GetVSyncProvider() { | 195 gfx::VSyncProvider* GLSurface::GetVSyncProvider() { |
196 return NULL; | 196 return NULL; |
197 } | 197 } |
198 | 198 |
199 bool GLSurface::ScheduleOverlayPlane(int z_order, | 199 bool GLSurface::ScheduleOverlayPlane(int z_order, |
200 OverlayTransform transform, | 200 gfx::OverlayTransform transform, |
201 gl::GLImage* image, | 201 gl::GLImage* image, |
202 const Rect& bounds_rect, | 202 const gfx::Rect& bounds_rect, |
203 const RectF& crop_rect) { | 203 const gfx::RectF& crop_rect) { |
204 NOTIMPLEMENTED(); | 204 NOTIMPLEMENTED(); |
205 return false; | 205 return false; |
206 } | 206 } |
207 | 207 |
208 bool GLSurface::ScheduleCALayer(gl::GLImage* contents_image, | 208 bool GLSurface::ScheduleCALayer(gl::GLImage* contents_image, |
209 const RectF& contents_rect, | 209 const gfx::RectF& contents_rect, |
210 float opacity, | 210 float opacity, |
211 unsigned background_color, | 211 unsigned background_color, |
212 unsigned edge_aa_mask, | 212 unsigned edge_aa_mask, |
213 const RectF& rect, | 213 const gfx::RectF& rect, |
214 bool is_clipped, | 214 bool is_clipped, |
215 const RectF& clip_rect, | 215 const gfx::RectF& clip_rect, |
216 const Transform& transform, | 216 const gfx::Transform& transform, |
217 int sorting_content_id, | 217 int sorting_content_id, |
218 unsigned filter) { | 218 unsigned filter) { |
219 NOTIMPLEMENTED(); | 219 NOTIMPLEMENTED(); |
220 return false; | 220 return false; |
221 } | 221 } |
222 | 222 |
223 bool GLSurface::IsSurfaceless() const { | 223 bool GLSurface::IsSurfaceless() const { |
224 return false; | 224 return false; |
225 } | 225 } |
226 | 226 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 368 } |
369 | 369 |
370 void* GLSurfaceAdapter::GetConfig() { | 370 void* GLSurfaceAdapter::GetConfig() { |
371 return surface_->GetConfig(); | 371 return surface_->GetConfig(); |
372 } | 372 } |
373 | 373 |
374 GLSurface::Format GLSurfaceAdapter::GetFormat() { | 374 GLSurface::Format GLSurfaceAdapter::GetFormat() { |
375 return surface_->GetFormat(); | 375 return surface_->GetFormat(); |
376 } | 376 } |
377 | 377 |
378 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { | 378 gfx::VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { |
379 return surface_->GetVSyncProvider(); | 379 return surface_->GetVSyncProvider(); |
380 } | 380 } |
381 | 381 |
382 bool GLSurfaceAdapter::ScheduleOverlayPlane(int z_order, | 382 bool GLSurfaceAdapter::ScheduleOverlayPlane(int z_order, |
383 OverlayTransform transform, | 383 gfx::OverlayTransform transform, |
384 gl::GLImage* image, | 384 gl::GLImage* image, |
385 const Rect& bounds_rect, | 385 const gfx::Rect& bounds_rect, |
386 const RectF& crop_rect) { | 386 const gfx::RectF& crop_rect) { |
387 return surface_->ScheduleOverlayPlane( | 387 return surface_->ScheduleOverlayPlane( |
388 z_order, transform, image, bounds_rect, crop_rect); | 388 z_order, transform, image, bounds_rect, crop_rect); |
389 } | 389 } |
390 | 390 |
391 bool GLSurfaceAdapter::IsSurfaceless() const { | 391 bool GLSurfaceAdapter::IsSurfaceless() const { |
392 return surface_->IsSurfaceless(); | 392 return surface_->IsSurfaceless(); |
393 } | 393 } |
394 | 394 |
395 bool GLSurfaceAdapter::FlipsVertically() const { | 395 bool GLSurfaceAdapter::FlipsVertically() const { |
396 return surface_->FlipsVertically(); | 396 return surface_->FlipsVertically(); |
397 } | 397 } |
398 | 398 |
399 bool GLSurfaceAdapter::BuffersFlipped() const { | 399 bool GLSurfaceAdapter::BuffersFlipped() const { |
400 return surface_->BuffersFlipped(); | 400 return surface_->BuffersFlipped(); |
401 } | 401 } |
402 | 402 |
403 GLSurfaceAdapter::~GLSurfaceAdapter() {} | 403 GLSurfaceAdapter::~GLSurfaceAdapter() {} |
404 | 404 |
405 } // namespace gfx | 405 } // namespace gl |
OLD | NEW |