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