| 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 "gpu/gles2_conform_support/egl/display.h" | 5 #include "gpu/gles2_conform_support/egl/display.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace egl { | 28 namespace egl { |
| 29 | 29 |
| 30 Display::Display(EGLNativeDisplayType display_id) | 30 Display::Display(EGLNativeDisplayType display_id) |
| 31 : display_id_(display_id), | 31 : display_id_(display_id), |
| 32 is_initialized_(false), | 32 is_initialized_(false), |
| 33 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) | 33 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) |
| 34 exit_manager_(new base::AtExitManager), | 34 exit_manager_(new base::AtExitManager), |
| 35 #endif | 35 #endif |
| 36 create_offscreen_(false), | 36 create_offscreen_(false), |
| 37 create_offscreen_width_(0), | 37 create_offscreen_width_(0), |
| 38 create_offscreen_height_(0) { | 38 create_offscreen_height_(0), |
| 39 next_fence_sync_release_(1) { |
| 39 } | 40 } |
| 40 | 41 |
| 41 Display::~Display() { | 42 Display::~Display() { |
| 42 gles2::Terminate(); | 43 gles2::Terminate(); |
| 43 } | 44 } |
| 44 | 45 |
| 45 bool Display::Initialize() { | 46 bool Display::Initialize() { |
| 46 gles2::Initialize(); | 47 gles2::Initialize(); |
| 47 is_initialized_ = true; | 48 is_initialized_ = true; |
| 48 return true; | 49 return true; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 } | 346 } |
| 346 | 347 |
| 347 gpu::CommandBufferNamespace Display::GetNamespaceID() const { | 348 gpu::CommandBufferNamespace Display::GetNamespaceID() const { |
| 348 return gpu::CommandBufferNamespace::IN_PROCESS; | 349 return gpu::CommandBufferNamespace::IN_PROCESS; |
| 349 } | 350 } |
| 350 | 351 |
| 351 uint64_t Display::GetCommandBufferID() const { | 352 uint64_t Display::GetCommandBufferID() const { |
| 352 return 0; | 353 return 0; |
| 353 } | 354 } |
| 354 | 355 |
| 356 uint32_t Display::GenerateFenceSyncRelease() { |
| 357 return next_fence_sync_release_++; |
| 358 } |
| 359 |
| 360 bool Display::IsFenceSyncRelease(uint32_t release) { |
| 361 return release > 0 && release < next_fence_sync_release_; |
| 362 } |
| 363 |
| 364 bool Display::IsFenceSyncFlushed(uint32_t release) { |
| 365 return IsFenceSyncRelease(release); |
| 366 } |
| 367 |
| 355 } // namespace egl | 368 } // namespace egl |
| OLD | NEW |