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

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

Issue 1414793018: Revert of Converted video frame and image callbacks to use new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | cc/test/test_gpu_memory_buffer_manager.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 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 void GenerateSyncToken(gpu::SyncToken* sync_token) override { 78 uint32 InsertSyncPoint() override {
79 if (sync_token_.HasData()) { 79 if (sync_token_.HasData()) {
80 *sync_token = sync_token_; 80 DCHECK_EQ(gpu::CommandBufferNamespace::OLD_SYNC_POINTS,
81 } else { 81 sync_token_.namespace_id());
82 const uint64_t fence_sync = gl_->InsertFenceSyncCHROMIUM(); 82 return static_cast<uint32>(sync_token_.release_count());
83 gl_->ShallowFlushCHROMIUM();
84 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token->GetData());
85 } 83 }
84 return gl_->InsertSyncPointCHROMIUM();
86 } 85 }
87 void WaitSyncToken(const gpu::SyncToken& sync_token) override { 86 void WaitSyncToken(const gpu::SyncToken& sync_token) override {
88 if (sync_token.HasData()) { 87 if (sync_token.HasData()) {
89 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); 88 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData());
90 if (sync_token_.HasData()) { 89 if (sync_token_.HasData()) {
91 gl_->WaitSyncTokenCHROMIUM(sync_token_.GetConstData()); 90 gl_->WaitSyncTokenCHROMIUM(sync_token_.GetConstData());
92 sync_token_.Clear(); 91 sync_token_.Clear();
93 } 92 }
94 } 93 }
95 } 94 }
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 resource_it->ref_count = 0; 476 resource_it->ref_count = 0;
478 updater->DeleteResource(resource_it); 477 updater->DeleteResource(resource_it);
479 return; 478 return;
480 } 479 }
481 480
482 --resource_it->ref_count; 481 --resource_it->ref_count;
483 DCHECK_GE(resource_it->ref_count, 0); 482 DCHECK_GE(resource_it->ref_count, 0);
484 } 483 }
485 484
486 } // namespace cc 485 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/test_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698