| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 | 167 |
| 168 bool GLSurface::FlipsVertically() const { | 168 bool GLSurface::FlipsVertically() const { |
| 169 return false; | 169 return false; |
| 170 } | 170 } |
| 171 | 171 |
| 172 bool GLSurface::BuffersFlipped() const { | 172 bool GLSurface::BuffersFlipped() const { |
| 173 return false; | 173 return false; |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool GLSurface::SupportsSetDrawRectangle() const { |
| 177 return false; |
| 178 } |
| 179 |
| 180 bool GLSurface::SetDrawRectangle(const gfx::Rect& rect) { |
| 181 return false; |
| 182 } |
| 183 |
| 176 GLSurface* GLSurface::GetCurrent() { | 184 GLSurface* GLSurface::GetCurrent() { |
| 177 return current_surface_.Pointer()->Get(); | 185 return current_surface_.Pointer()->Get(); |
| 178 } | 186 } |
| 179 | 187 |
| 180 GLSurface::~GLSurface() { | 188 GLSurface::~GLSurface() { |
| 181 if (GetCurrent() == this) | 189 if (GetCurrent() == this) |
| 182 SetCurrent(NULL); | 190 SetCurrent(NULL); |
| 183 } | 191 } |
| 184 | 192 |
| 185 void GLSurface::SetCurrent(GLSurface* surface) { | 193 void GLSurface::SetCurrent(GLSurface* surface) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 355 } |
| 348 | 356 |
| 349 bool GLSurfaceAdapter::FlipsVertically() const { | 357 bool GLSurfaceAdapter::FlipsVertically() const { |
| 350 return surface_->FlipsVertically(); | 358 return surface_->FlipsVertically(); |
| 351 } | 359 } |
| 352 | 360 |
| 353 bool GLSurfaceAdapter::BuffersFlipped() const { | 361 bool GLSurfaceAdapter::BuffersFlipped() const { |
| 354 return surface_->BuffersFlipped(); | 362 return surface_->BuffersFlipped(); |
| 355 } | 363 } |
| 356 | 364 |
| 365 bool GLSurfaceAdapter::SupportsSetDrawRectangle() const { |
| 366 return surface_->SupportsSetDrawRectangle(); |
| 367 } |
| 368 |
| 369 bool GLSurfaceAdapter::SetDrawRectangle(const gfx::Rect& rect) { |
| 370 return surface_->SetDrawRectangle(rect); |
| 371 } |
| 372 |
| 357 GLSurfaceAdapter::~GLSurfaceAdapter() {} | 373 GLSurfaceAdapter::~GLSurfaceAdapter() {} |
| 358 | 374 |
| 359 scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( | 375 scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( |
| 360 scoped_refptr<GLSurface> surface, GLSurfaceFormat format) { | 376 scoped_refptr<GLSurface> surface, GLSurfaceFormat format) { |
| 361 if (!surface->Initialize(format)) | 377 if (!surface->Initialize(format)) |
| 362 return nullptr; | 378 return nullptr; |
| 363 return surface; | 379 return surface; |
| 364 } | 380 } |
| 365 | 381 |
| 366 scoped_refptr<GLSurface> InitializeGLSurface(scoped_refptr<GLSurface> surface) { | 382 scoped_refptr<GLSurface> InitializeGLSurface(scoped_refptr<GLSurface> surface) { |
| 367 return InitializeGLSurfaceWithFormat(surface, GLSurfaceFormat()); | 383 return InitializeGLSurfaceWithFormat(surface, GLSurfaceFormat()); |
| 368 } | 384 } |
| 369 | 385 |
| 370 GLSurface::CALayerInUseQuery::CALayerInUseQuery() = default; | 386 GLSurface::CALayerInUseQuery::CALayerInUseQuery() = default; |
| 371 GLSurface::CALayerInUseQuery::CALayerInUseQuery(const CALayerInUseQuery&) = | 387 GLSurface::CALayerInUseQuery::CALayerInUseQuery(const CALayerInUseQuery&) = |
| 372 default; | 388 default; |
| 373 GLSurface::CALayerInUseQuery::~CALayerInUseQuery() = default; | 389 GLSurface::CALayerInUseQuery::~CALayerInUseQuery() = default; |
| 374 | 390 |
| 375 } // namespace gl | 391 } // namespace gl |
| OLD | NEW |