Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed memory leak Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/command_buffer/tests/gl_manager.h" 5 #include "gpu/command_buffer/tests/gl_manager.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 GLManager::Options::Options() 104 GLManager::Options::Options()
105 : size(4, 4), 105 : size(4, 4),
106 share_group_manager(NULL), 106 share_group_manager(NULL),
107 share_mailbox_manager(NULL), 107 share_mailbox_manager(NULL),
108 virtual_manager(NULL), 108 virtual_manager(NULL),
109 bind_generates_resource(false), 109 bind_generates_resource(false),
110 lose_context_when_out_of_memory(false), 110 lose_context_when_out_of_memory(false),
111 context_lost_allowed(false), 111 context_lost_allowed(false),
112 context_type(gles2::CONTEXT_TYPE_OPENGLES2) {} 112 context_type(gles2::CONTEXT_TYPE_OPENGLES2) {}
113 113
114 GLManager::GLManager() : context_lost_allowed_(false) { 114 GLManager::GLManager()
115 : context_lost_allowed_(false),
116 next_fence_sync_release_(1) {
115 SetupBaseContext(); 117 SetupBaseContext();
116 } 118 }
117 119
118 GLManager::~GLManager() { 120 GLManager::~GLManager() {
119 --use_count_; 121 --use_count_;
120 if (!use_count_) { 122 if (!use_count_) {
121 if (base_share_group_) { 123 if (base_share_group_) {
122 delete base_context_; 124 delete base_context_;
123 base_context_ = NULL; 125 base_context_ = NULL;
124 } 126 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 } 439 }
438 440
439 gpu::CommandBufferNamespace GLManager::GetNamespaceID() const { 441 gpu::CommandBufferNamespace GLManager::GetNamespaceID() const {
440 return gpu::CommandBufferNamespace::IN_PROCESS; 442 return gpu::CommandBufferNamespace::IN_PROCESS;
441 } 443 }
442 444
443 uint64_t GLManager::GetCommandBufferID() const { 445 uint64_t GLManager::GetCommandBufferID() const {
444 return 0; 446 return 0;
445 } 447 }
446 448
449 uint64_t GLManager::GenerateFenceSyncRelease() {
450 return next_fence_sync_release_++;
451 }
452
453 bool GLManager::IsFenceSyncRelease(uint64_t release) {
454 return release > 0 && release < next_fence_sync_release_;
455 }
456
457 bool GLManager::IsFenceSyncFlushed(uint64_t release) {
458 return IsFenceSyncRelease(release);
459 }
460
447 } // namespace gpu 461 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698