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

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: Patch Created 8 years, 6 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 scoped_refptr<gpu::RefCountedCounter> unprocessed_messages_; 143 scoped_refptr<gpu::RefCountedCounter> unprocessed_messages_;
144 }; 144 };
145 145
146 } // anonymous namespace 146 } // anonymous namespace
147 147
148 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, 148 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
149 GpuWatchdog* watchdog, 149 GpuWatchdog* watchdog,
150 gfx::GLShareGroup* share_group, 150 gfx::GLShareGroup* share_group,
151 gpu::gles2::MailboxManager* mailbox, 151 gpu::gles2::MailboxManager* mailbox,
152 int client_id, 152 int client_id,
153 bool software) 153 bool software,
154 gpu::gles2::ProgramCache* program_cache)
154 : gpu_channel_manager_(gpu_channel_manager), 155 : gpu_channel_manager_(gpu_channel_manager),
156 program_cache_(program_cache),
155 unprocessed_messages_(new gpu::RefCountedCounter), 157 unprocessed_messages_(new gpu::RefCountedCounter),
156 client_id_(client_id), 158 client_id_(client_id),
157 share_group_(share_group ? share_group : new gfx::GLShareGroup), 159 share_group_(share_group ? share_group : new gfx::GLShareGroup),
158 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager), 160 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager),
159 watchdog_(watchdog), 161 watchdog_(watchdog),
160 software_(software), 162 software_(software),
161 handle_messages_scheduled_(false), 163 handle_messages_scheduled_(false),
162 processed_get_state_fast_(false), 164 processed_get_state_fast_(false),
163 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 165 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
164 DCHECK(gpu_channel_manager); 166 DCHECK(gpu_channel_manager);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 window, 327 window,
326 mailbox_manager_, 328 mailbox_manager_,
327 gfx::Size(), 329 gfx::Size(),
328 disallowed_features_, 330 disallowed_features_,
329 init_params.allowed_extensions, 331 init_params.allowed_extensions,
330 init_params.attribs, 332 init_params.attribs,
331 init_params.gpu_preference, 333 init_params.gpu_preference,
332 *route_id, 334 *route_id,
333 surface_id, 335 surface_id,
334 watchdog_, 336 watchdog_,
335 software_)); 337 software_,
338 program_cache_));
336 if (preempt_by_counter_.get()) 339 if (preempt_by_counter_.get())
337 stub->SetPreemptByCounter(preempt_by_counter_); 340 stub->SetPreemptByCounter(preempt_by_counter_);
338 router_.AddRoute(*route_id, stub.get()); 341 router_.AddRoute(*route_id, stub.get());
339 stubs_.AddWithID(stub.release(), *route_id); 342 stubs_.AddWithID(stub.release(), *route_id);
340 #endif // ENABLE_GPU 343 #endif // ENABLE_GPU
341 } 344 }
342 345
343 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { 346 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) {
344 return stubs_.Lookup(route_id); 347 return stubs_.Lookup(route_id);
345 } 348 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 share_group, 496 share_group,
494 gfx::GLSurfaceHandle(), 497 gfx::GLSurfaceHandle(),
495 mailbox_manager_.get(), 498 mailbox_manager_.get(),
496 size, 499 size,
497 disallowed_features_, 500 disallowed_features_,
498 init_params.allowed_extensions, 501 init_params.allowed_extensions,
499 init_params.attribs, 502 init_params.attribs,
500 init_params.gpu_preference, 503 init_params.gpu_preference,
501 route_id, 504 route_id,
502 0, watchdog_, 505 0, watchdog_,
503 software_)); 506 software_,
507 program_cache_));
504 if (preempt_by_counter_.get()) 508 if (preempt_by_counter_.get())
505 stub->SetPreemptByCounter(preempt_by_counter_); 509 stub->SetPreemptByCounter(preempt_by_counter_);
506 router_.AddRoute(route_id, stub.get()); 510 router_.AddRoute(route_id, stub.get());
507 stubs_.AddWithID(stub.release(), route_id); 511 stubs_.AddWithID(stub.release(), route_id);
508 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", 512 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer",
509 "route_id", route_id); 513 "route_id", route_id);
510 #endif 514 #endif
511 515
512 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams( 516 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams(
513 reply_message, 517 reply_message,
(...skipping 14 matching lines...) Expand all
528 // In case the renderer is currently blocked waiting for a sync reply from 532 // In case the renderer is currently blocked waiting for a sync reply from
529 // the stub, we need to make sure to reschedule the GpuChannel here. 533 // the stub, we need to make sure to reschedule the GpuChannel here.
530 if (need_reschedule) 534 if (need_reschedule)
531 OnScheduled(); 535 OnScheduled();
532 } 536 }
533 537
534 if (reply_message) 538 if (reply_message)
535 Send(reply_message); 539 Send(reply_message);
536 } 540 }
537 541
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698