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