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

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

Issue 2447533002: ui: Add ref-counting to GLFence class.
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « gpu/command_buffer/service/query_manager.cc ('k') | gpu/ipc/service/gpu_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <stddef.h> 10 #include <stddef.h>
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 } 671 }
672 672
673 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { 673 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) {
674 return false; 674 return false;
675 } 675 }
676 676
677 int32_t GLManager::CreateFence(ClientFence fence) { 677 int32_t GLManager::CreateFence(ClientFence fence) {
678 GpuFenceImpl* gpu_fence = GpuFenceImpl::FromClientFence(fence); 678 GpuFenceImpl* gpu_fence = GpuFenceImpl::FromClientFence(fence);
679 679
680 gfx::GpuFenceHandle handle = gpu_fence->GetHandle(); 680 gfx::GpuFenceHandle handle = gpu_fence->GetHandle();
681 std::unique_ptr<gl::GLFenceSharedEvent> gl_fence(new gl::GLFenceSharedEvent( 681 scoped_refptr<gl::GLFenceSharedEvent> gl_fence(new gl::GLFenceSharedEvent(
682 gfx::SharedEvent::DuplicateHandle(handle.shared_event_handle))); 682 gfx::SharedEvent::DuplicateHandle(handle.shared_event_handle)));
683 683
684 static int32_t next_id = 1; 684 static int32_t next_id = 1;
685 int32_t new_id = next_id++; 685 int32_t new_id = next_id++;
686 gpu::gles2::FenceManager* fence_manager = decoder_->GetFenceManager(); 686 gpu::gles2::FenceManager* fence_manager = decoder_->GetFenceManager();
687 DCHECK(fence_manager); 687 DCHECK(fence_manager);
688 fence_manager->AddFence(std::move(gl_fence), new_id); 688 fence_manager->AddFence(gl_fence.get(), new_id);
689 return new_id; 689 return new_id;
690 } 690 }
691 691
692 void GLManager::DestroyFence(int32_t id) { 692 void GLManager::DestroyFence(int32_t id) {
693 gpu::gles2::FenceManager* fence_manager = decoder_->GetFenceManager(); 693 gpu::gles2::FenceManager* fence_manager = decoder_->GetFenceManager();
694 DCHECK(fence_manager); 694 DCHECK(fence_manager);
695 fence_manager->RemoveFence(id); 695 fence_manager->RemoveFence(id);
696 } 696 }
697 697
698 } // namespace gpu 698 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/query_manager.cc ('k') | gpu/ipc/service/gpu_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698