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

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

Issue 1602313002: Removed client side support for old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed DrawingBufferTest reference Created 4 years, 11 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
« no previous file with comments | « no previous file | cc/test/test_gles2_interface.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 base::hash_map<unsigned, uint32_t> sync_point_for_mailbox_; 186 base::hash_map<unsigned, uint32_t> sync_point_for_mailbox_;
187 }; 187 };
188 188
189 class ResourceProviderContext : public TestWebGraphicsContext3D { 189 class ResourceProviderContext : public TestWebGraphicsContext3D {
190 public: 190 public:
191 static scoped_ptr<ResourceProviderContext> Create( 191 static scoped_ptr<ResourceProviderContext> Create(
192 ContextSharedData* shared_data) { 192 ContextSharedData* shared_data) {
193 return make_scoped_ptr(new ResourceProviderContext(shared_data)); 193 return make_scoped_ptr(new ResourceProviderContext(shared_data));
194 } 194 }
195 195
196 GLuint insertSyncPoint() override {
197 const uint32_t sync_point =
198 static_cast<uint32_t>(shared_data_->InsertFenceSync());
199 gpu::SyncToken sync_token_data(sync_point);
200
201 // Commit the produceTextureCHROMIUM calls at this point, so that
202 // they're associated with the sync point.
203 for (const scoped_ptr<PendingProduceTexture>& pending_texture :
204 pending_produce_textures_) {
205 shared_data_->ProduceTexture(pending_texture->mailbox, sync_token_data,
206 pending_texture->texture);
207 }
208 pending_produce_textures_.clear();
209 return sync_point;
210 }
211
212 GLuint64 insertFenceSync() override { 196 GLuint64 insertFenceSync() override {
213 return shared_data_->InsertFenceSync(); 197 return shared_data_->InsertFenceSync();
214 } 198 }
215 199
216 void genSyncToken(GLuint64 fence_sync, GLbyte* sync_token) override { 200 void genSyncToken(GLuint64 fence_sync, GLbyte* sync_token) override {
217 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0, 201 gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0,
218 0x123, fence_sync); 202 0x123, fence_sync);
219 sync_token_data.SetVerifyFlush(); 203 sync_token_data.SetVerifyFlush();
220 // Commit the produceTextureCHROMIUM calls at this point, so that 204 // Commit the produceTextureCHROMIUM calls at this point, so that
221 // they're associated with the sync point. 205 // they're associated with the sync point.
(...skipping 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3629 EXPECT_TRUE(resource_provider_->CanLockForWrite(id)); 3613 EXPECT_TRUE(resource_provider_->CanLockForWrite(id));
3630 EXPECT_FALSE(resource_provider_->InUseByConsumer(id)); 3614 EXPECT_FALSE(resource_provider_->InUseByConsumer(id));
3631 gpu_memory_buffer_manager_->SetGpuMemoryBufferIsInUseByMacOSWindowServer( 3615 gpu_memory_buffer_manager_->SetGpuMemoryBufferIsInUseByMacOSWindowServer(
3632 gpu_memory_buffer, true); 3616 gpu_memory_buffer, true);
3633 EXPECT_FALSE(resource_provider_->CanLockForWrite(id)); 3617 EXPECT_FALSE(resource_provider_->CanLockForWrite(id));
3634 EXPECT_TRUE(resource_provider_->InUseByConsumer(id)); 3618 EXPECT_TRUE(resource_provider_->InUseByConsumer(id));
3635 } 3619 }
3636 3620
3637 } // namespace 3621 } // namespace
3638 } // namespace cc 3622 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/test_gles2_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698