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

Unified Diff: content/common/gpu/gpu_channel_manager.cc

Issue 1336623004: content/gpu: Simplify gpu channel message handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng's final comments Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index 0359393f1ae0f1075585f4c21ffdf04b4248641a..99415185a7a33089533623b68a1451ce23134dc4 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -107,7 +107,7 @@ void GpuChannelManager::RemoveRoute(int32 routing_id) {
router_.RemoveRoute(routing_id);
}
-GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) {
+GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) const {
const auto& it = gpu_channels_.find(client_id);
return it != gpu_channels_.end() ? it->second : nullptr;
}
@@ -251,16 +251,7 @@ void GpuChannelManager::OnLoadedShader(std::string program_proto) {
program_cache()->LoadProgram(program_proto);
}
-uint32_t GpuChannelManager::ProcessedOrderNumber() {
- uint32_t processed_order_num = 0;
- for (auto& kv : gpu_channels_) {
- processed_order_num =
- std::max(processed_order_num, kv.second->GetProcessedOrderNum());
- }
- return processed_order_num;
-}
-
-uint32_t GpuChannelManager::UnprocessedOrderNumber() {
+uint32_t GpuChannelManager::GetUnprocessedOrderNum() const {
uint32_t unprocessed_order_num = 0;
for (auto& kv : gpu_channels_) {
unprocessed_order_num =
@@ -269,6 +260,15 @@ uint32_t GpuChannelManager::UnprocessedOrderNumber() {
return unprocessed_order_num;
}
+uint32_t GpuChannelManager::GetProcessedOrderNum() const {
+ uint32_t processed_order_num = 0;
+ for (auto& kv : gpu_channels_) {
+ processed_order_num =
+ std::max(processed_order_num, kv.second->GetProcessedOrderNum());
+ }
+ return processed_order_num;
+}
+
void GpuChannelManager::LoseAllContexts() {
for (auto& kv : gpu_channels_) {
kv.second->MarkAllContextsLost();
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698