| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 bool GLSurface::SupportsPostSubBuffer() { | 186 bool GLSurface::SupportsPostSubBuffer() { |
| 187 return false; | 187 return false; |
| 188 } | 188 } |
| 189 | 189 |
| 190 unsigned int GLSurface::GetBackingFrameBufferObject() { | 190 unsigned int GLSurface::GetBackingFrameBufferObject() { |
| 191 return 0; | 191 return 0; |
| 192 } | 192 } |
| 193 | 193 |
| 194 bool GLSurface::SwapBuffersAsync(const SwapCompletionCallback& callback) { |
| 195 DCHECK(!IsSurfaceless()); |
| 196 bool success = SwapBuffers(); |
| 197 callback.Run(); |
| 198 return success; |
| 199 } |
| 200 |
| 194 bool GLSurface::PostSubBuffer(int x, int y, int width, int height) { | 201 bool GLSurface::PostSubBuffer(int x, int y, int width, int height) { |
| 195 return false; | 202 return false; |
| 196 } | 203 } |
| 197 | 204 |
| 205 bool GLSurface::PostSubBufferAsync(int x, |
| 206 int y, |
| 207 int width, |
| 208 int height, |
| 209 const SwapCompletionCallback& callback) { |
| 210 bool success = PostSubBuffer(x, y, width, height); |
| 211 callback.Run(); |
| 212 return success; |
| 213 } |
| 214 |
| 198 bool GLSurface::OnMakeCurrent(GLContext* context) { | 215 bool GLSurface::OnMakeCurrent(GLContext* context) { |
| 199 return true; | 216 return true; |
| 200 } | 217 } |
| 201 | 218 |
| 202 bool GLSurface::SetBackbufferAllocation(bool allocated) { | 219 bool GLSurface::SetBackbufferAllocation(bool allocated) { |
| 203 return true; | 220 return true; |
| 204 } | 221 } |
| 205 | 222 |
| 206 void GLSurface::SetFrontbufferAllocation(bool allocated) { | 223 void GLSurface::SetFrontbufferAllocation(bool allocated) { |
| 207 } | 224 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 309 } |
| 293 | 310 |
| 294 bool GLSurfaceAdapter::IsOffscreen() { | 311 bool GLSurfaceAdapter::IsOffscreen() { |
| 295 return surface_->IsOffscreen(); | 312 return surface_->IsOffscreen(); |
| 296 } | 313 } |
| 297 | 314 |
| 298 bool GLSurfaceAdapter::SwapBuffers() { | 315 bool GLSurfaceAdapter::SwapBuffers() { |
| 299 return surface_->SwapBuffers(); | 316 return surface_->SwapBuffers(); |
| 300 } | 317 } |
| 301 | 318 |
| 319 bool GLSurfaceAdapter::SwapBuffersAsync( |
| 320 const SwapCompletionCallback& callback) { |
| 321 return surface_->SwapBuffersAsync(callback); |
| 322 } |
| 323 |
| 302 bool GLSurfaceAdapter::PostSubBuffer(int x, int y, int width, int height) { | 324 bool GLSurfaceAdapter::PostSubBuffer(int x, int y, int width, int height) { |
| 303 return surface_->PostSubBuffer(x, y, width, height); | 325 return surface_->PostSubBuffer(x, y, width, height); |
| 304 } | 326 } |
| 305 | 327 |
| 328 bool GLSurfaceAdapter::PostSubBufferAsync( |
| 329 int x, int y, int width, int height, |
| 330 const SwapCompletionCallback& callback) { |
| 331 return surface_->PostSubBufferAsync(x, y, width, height, callback); |
| 332 } |
| 333 |
| 306 bool GLSurfaceAdapter::SupportsPostSubBuffer() { | 334 bool GLSurfaceAdapter::SupportsPostSubBuffer() { |
| 307 return surface_->SupportsPostSubBuffer(); | 335 return surface_->SupportsPostSubBuffer(); |
| 308 } | 336 } |
| 309 | 337 |
| 310 gfx::Size GLSurfaceAdapter::GetSize() { | 338 gfx::Size GLSurfaceAdapter::GetSize() { |
| 311 return surface_->GetSize(); | 339 return surface_->GetSize(); |
| 312 } | 340 } |
| 313 | 341 |
| 314 void* GLSurfaceAdapter::GetHandle() { | 342 void* GLSurfaceAdapter::GetHandle() { |
| 315 return surface_->GetHandle(); | 343 return surface_->GetHandle(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 z_order, transform, image, bounds_rect, crop_rect); | 388 z_order, transform, image, bounds_rect, crop_rect); |
| 361 } | 389 } |
| 362 | 390 |
| 363 bool GLSurfaceAdapter::IsSurfaceless() const { | 391 bool GLSurfaceAdapter::IsSurfaceless() const { |
| 364 return surface_->IsSurfaceless(); | 392 return surface_->IsSurfaceless(); |
| 365 } | 393 } |
| 366 | 394 |
| 367 GLSurfaceAdapter::~GLSurfaceAdapter() {} | 395 GLSurfaceAdapter::~GLSurfaceAdapter() {} |
| 368 | 396 |
| 369 } // namespace gfx | 397 } // namespace gfx |
| OLD | NEW |