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

Side by Side Diff: components/mus/gles2/command_buffer_driver.cc

Issue 1548443002: Introducing gpu::CommandBufferId as a distinct, IdType<...>-based type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-save-package-id-self-contained
Patch Set: Rebasing... Created 4 years, 10 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 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 "components/mus/gles2/command_buffer_driver.h" 5 #include "components/mus/gles2/command_buffer_driver.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // Prevents idle work from being starved. 47 // Prevents idle work from being starved.
48 const int64_t kMaxTimeSinceIdleMs = 10; 48 const int64_t kMaxTimeSinceIdleMs = 10;
49 49
50 } // namespace 50 } // namespace
51 51
52 CommandBufferDriver::Client::~Client() {} 52 CommandBufferDriver::Client::~Client() {}
53 53
54 CommandBufferDriver::CommandBufferDriver( 54 CommandBufferDriver::CommandBufferDriver(
55 gpu::CommandBufferNamespace command_buffer_namespace, 55 gpu::CommandBufferNamespace command_buffer_namespace,
56 uint64_t command_buffer_id, 56 gpu::CommandBufferId command_buffer_id,
57 gfx::AcceleratedWidget widget, 57 gfx::AcceleratedWidget widget,
58 scoped_refptr<GpuState> gpu_state) 58 scoped_refptr<GpuState> gpu_state)
59 : command_buffer_namespace_(command_buffer_namespace), 59 : command_buffer_namespace_(command_buffer_namespace),
60 command_buffer_id_(command_buffer_id), 60 command_buffer_id_(command_buffer_id),
61 widget_(widget), 61 widget_(widget),
62 client_(nullptr), 62 client_(nullptr),
63 gpu_state_(gpu_state), 63 gpu_state_(gpu_state),
64 previous_processed_num_(0), 64 previous_processed_num_(0),
65 weak_factory_(this) { 65 weak_factory_(this) {
66 DCHECK_EQ(base::ThreadTaskRunnerHandle::Get(), 66 DCHECK_EQ(base::ThreadTaskRunnerHandle::Get(),
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 } 443 }
444 444
445 void CommandBufferDriver::OnFenceSyncRelease(uint64_t release) { 445 void CommandBufferDriver::OnFenceSyncRelease(uint64_t release) {
446 DCHECK(CalledOnValidThread()); 446 DCHECK(CalledOnValidThread());
447 if (!sync_point_client_->client_state()->IsFenceSyncReleased(release)) 447 if (!sync_point_client_->client_state()->IsFenceSyncReleased(release))
448 sync_point_client_->ReleaseFenceSync(release); 448 sync_point_client_->ReleaseFenceSync(release);
449 } 449 }
450 450
451 bool CommandBufferDriver::OnWaitFenceSync( 451 bool CommandBufferDriver::OnWaitFenceSync(
452 gpu::CommandBufferNamespace namespace_id, 452 gpu::CommandBufferNamespace namespace_id,
453 uint64_t command_buffer_id, 453 gpu::CommandBufferId command_buffer_id,
454 uint64_t release) { 454 uint64_t release) {
455 DCHECK(CalledOnValidThread()); 455 DCHECK(CalledOnValidThread());
456 DCHECK(IsScheduled()); 456 DCHECK(IsScheduled());
457 gpu::SyncPointManager* sync_point_manager = gpu_state_->sync_point_manager(); 457 gpu::SyncPointManager* sync_point_manager = gpu_state_->sync_point_manager();
458 DCHECK(sync_point_manager); 458 DCHECK(sync_point_manager);
459 459
460 scoped_refptr<gpu::SyncPointClientState> release_state = 460 scoped_refptr<gpu::SyncPointClientState> release_state =
461 sync_point_manager->GetSyncPointClientState(namespace_id, 461 sync_point_manager->GetSyncPointClientState(namespace_id,
462 command_buffer_id); 462 command_buffer_id);
463 463
(...skipping 27 matching lines...) Expand all
491 491
492 gpu::gles2::QueryManager* query_manager = decoder_->GetQueryManager(); 492 gpu::gles2::QueryManager* query_manager = decoder_->GetQueryManager();
493 gpu::gles2::QueryManager::Query* query = query_manager->GetQuery(query_id); 493 gpu::gles2::QueryManager::Query* query = query_manager->GetQuery(query_id);
494 if (query) 494 if (query)
495 query->AddCallback(callback); 495 query->AddCallback(callback);
496 else 496 else
497 callback.Run(); 497 callback.Run();
498 } 498 }
499 499
500 } // namespace mus 500 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/gles2/command_buffer_driver.h ('k') | components/mus/gles2/command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698