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

Side by Side Diff: cc/resources/video_resource_updater.cc

Issue 1429213002: Converted video frame and image callbacks to use new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shallow flush before image creation Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/resources/video_resource_updater.h" 5 #include "cc/resources/video_resource_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 return VideoFrameExternalResources::NONE; 69 return VideoFrameExternalResources::NONE;
70 } 70 }
71 71
72 class SyncTokenClientImpl : public media::VideoFrame::SyncTokenClient { 72 class SyncTokenClientImpl : public media::VideoFrame::SyncTokenClient {
73 public: 73 public:
74 SyncTokenClientImpl(gpu::gles2::GLES2Interface* gl, 74 SyncTokenClientImpl(gpu::gles2::GLES2Interface* gl,
75 const gpu::SyncToken& sync_token) 75 const gpu::SyncToken& sync_token)
76 : gl_(gl), sync_token_(sync_token) {} 76 : gl_(gl), sync_token_(sync_token) {}
77 ~SyncTokenClientImpl() override {} 77 ~SyncTokenClientImpl() override {}
78 uint32 InsertSyncPoint() override { 78 void GenerateSyncToken(gpu::SyncToken* sync_token) override {
79 if (sync_token_.HasData()) { 79 if (sync_token_.HasData()) {
80 DCHECK_EQ(gpu::CommandBufferNamespace::OLD_SYNC_POINTS, 80 *sync_token = sync_token_;
81 sync_token_.namespace_id()); 81 } else {
82 return static_cast<uint32>(sync_token_.release_count()); 82 const uint64_t fence_sync = gl_->InsertFenceSyncCHROMIUM();
83 gl_->Flush();
piman 2015/11/05 00:04:36 ShallowFlushCHROMIUM instead off Flush: - it doesn
David Yen 2015/11/05 00:34:27 Done.
84 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token->GetData());
83 } 85 }
84 return gl_->InsertSyncPointCHROMIUM();
85 } 86 }
86 void WaitSyncToken(const gpu::SyncToken& sync_token) override { 87 void WaitSyncToken(const gpu::SyncToken& sync_token) override {
87 if (sync_token.HasData()) { 88 if (sync_token.HasData()) {
88 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); 89 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData());
89 if (sync_token_.HasData()) { 90 if (sync_token_.HasData()) {
90 gl_->WaitSyncTokenCHROMIUM(sync_token_.GetConstData()); 91 gl_->WaitSyncTokenCHROMIUM(sync_token_.GetConstData());
91 sync_token_.Clear(); 92 sync_token_.Clear();
92 } 93 }
93 } 94 }
94 } 95 }
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 resource_it->ref_count = 0; 477 resource_it->ref_count = 0;
477 updater->DeleteResource(resource_it); 478 updater->DeleteResource(resource_it);
478 return; 479 return;
479 } 480 }
480 481
481 --resource_it->ref_count; 482 --resource_it->ref_count;
482 DCHECK_GE(resource_it->ref_count, 0); 483 DCHECK_GE(resource_it->ref_count, 0);
483 } 484 }
484 485
485 } // namespace cc 486 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/test_gpu_memory_buffer_manager.h » ('j') | content/common/gpu/client/command_buffer_proxy_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698