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

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 10534173: GPU Program Caching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Style fixes, thorough tests Created 8 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 scoped_refptr<gpu::RefCountedCounter> unprocessed_messages_; 137 scoped_refptr<gpu::RefCountedCounter> unprocessed_messages_;
138 }; 138 };
139 139
140 } // anonymous namespace 140 } // anonymous namespace
141 141
142 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, 142 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
143 GpuWatchdog* watchdog, 143 GpuWatchdog* watchdog,
144 gfx::GLShareGroup* share_group, 144 gfx::GLShareGroup* share_group,
145 gpu::gles2::MailboxManager* mailbox, 145 gpu::gles2::MailboxManager* mailbox,
146 int client_id, 146 int client_id,
147 bool software) 147 bool software,
148 gpu::gles2::ProgramCache* program_cache)
148 : gpu_channel_manager_(gpu_channel_manager), 149 : gpu_channel_manager_(gpu_channel_manager),
150 program_cache_(program_cache),
149 unprocessed_messages_(new gpu::RefCountedCounter), 151 unprocessed_messages_(new gpu::RefCountedCounter),
150 client_id_(client_id), 152 client_id_(client_id),
151 share_group_(share_group ? share_group : new gfx::GLShareGroup), 153 share_group_(share_group ? share_group : new gfx::GLShareGroup),
152 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager), 154 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager),
153 watchdog_(watchdog), 155 watchdog_(watchdog),
154 software_(software), 156 software_(software),
155 handle_messages_scheduled_(false), 157 handle_messages_scheduled_(false),
156 processed_get_state_fast_(false), 158 processed_get_state_fast_(false),
157 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 159 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
158 DCHECK(gpu_channel_manager); 160 DCHECK(gpu_channel_manager);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 window, 321 window,
320 mailbox_manager_, 322 mailbox_manager_,
321 gfx::Size(), 323 gfx::Size(),
322 disallowed_features_, 324 disallowed_features_,
323 init_params.allowed_extensions, 325 init_params.allowed_extensions,
324 init_params.attribs, 326 init_params.attribs,
325 init_params.gpu_preference, 327 init_params.gpu_preference,
326 *route_id, 328 *route_id,
327 surface_id, 329 surface_id,
328 watchdog_, 330 watchdog_,
329 software_)); 331 software_,
332 program_cache_));
330 if (preempt_by_counter_.get()) 333 if (preempt_by_counter_.get())
331 stub->SetPreemptByCounter(preempt_by_counter_); 334 stub->SetPreemptByCounter(preempt_by_counter_);
332 router_.AddRoute(*route_id, stub.get()); 335 router_.AddRoute(*route_id, stub.get());
333 stubs_.AddWithID(stub.release(), *route_id); 336 stubs_.AddWithID(stub.release(), *route_id);
334 #endif // ENABLE_GPU 337 #endif // ENABLE_GPU
335 } 338 }
336 339
337 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { 340 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) {
338 return stubs_.Lookup(route_id); 341 return stubs_.Lookup(route_id);
339 } 342 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 share_group, 467 share_group,
465 gfx::GLSurfaceHandle(), 468 gfx::GLSurfaceHandle(),
466 mailbox_manager_.get(), 469 mailbox_manager_.get(),
467 size, 470 size,
468 disallowed_features_, 471 disallowed_features_,
469 init_params.allowed_extensions, 472 init_params.allowed_extensions,
470 init_params.attribs, 473 init_params.attribs,
471 init_params.gpu_preference, 474 init_params.gpu_preference,
472 route_id, 475 route_id,
473 0, watchdog_, 476 0, watchdog_,
474 software_)); 477 software_,
478 program_cache_));
475 if (preempt_by_counter_.get()) 479 if (preempt_by_counter_.get())
476 stub->SetPreemptByCounter(preempt_by_counter_); 480 stub->SetPreemptByCounter(preempt_by_counter_);
477 router_.AddRoute(route_id, stub.get()); 481 router_.AddRoute(route_id, stub.get());
478 stubs_.AddWithID(stub.release(), route_id); 482 stubs_.AddWithID(stub.release(), route_id);
479 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", 483 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer",
480 "route_id", route_id); 484 "route_id", route_id);
481 #endif 485 #endif
482 486
483 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams( 487 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams(
484 reply_message, 488 reply_message,
(...skipping 14 matching lines...) Expand all
499 // In case the renderer is currently blocked waiting for a sync reply from 503 // In case the renderer is currently blocked waiting for a sync reply from
500 // the stub, we need to make sure to reschedule the GpuChannel here. 504 // the stub, we need to make sure to reschedule the GpuChannel here.
501 if (need_reschedule) 505 if (need_reschedule)
502 OnScheduled(); 506 OnScheduled();
503 } 507 }
504 508
505 if (reply_message) 509 if (reply_message)
506 Send(reply_message); 510 Send(reply_message);
507 } 511 }
508 512
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698