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

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: 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 scoped_refptr<base::MessageLoopProxy> message_loop_; 152 scoped_refptr<base::MessageLoopProxy> message_loop_;
153 }; 153 };
154 154
155 } // anonymous namespace 155 } // anonymous namespace
156 156
157 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, 157 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
158 GpuWatchdog* watchdog, 158 GpuWatchdog* watchdog,
159 gfx::GLShareGroup* share_group, 159 gfx::GLShareGroup* share_group,
160 gpu::gles2::MailboxManager* mailbox, 160 gpu::gles2::MailboxManager* mailbox,
161 int client_id, 161 int client_id,
162 bool software) 162 bool software,
163 base::WeakPtr<gpu::ShaderCache> shader_cache)
163 : gpu_channel_manager_(gpu_channel_manager), 164 : gpu_channel_manager_(gpu_channel_manager),
165 shader_cache_(shader_cache),
164 unprocessed_messages_(new gpu::RefCountedCounter), 166 unprocessed_messages_(new gpu::RefCountedCounter),
165 client_id_(client_id), 167 client_id_(client_id),
166 share_group_(share_group ? share_group : new gfx::GLShareGroup), 168 share_group_(share_group ? share_group : new gfx::GLShareGroup),
167 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager), 169 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager),
168 watchdog_(watchdog), 170 watchdog_(watchdog),
169 software_(software), 171 software_(software),
170 handle_messages_scheduled_(false), 172 handle_messages_scheduled_(false),
171 processed_get_state_fast_(false), 173 processed_get_state_fast_(false),
172 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 174 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
173 DCHECK(gpu_channel_manager); 175 DCHECK(gpu_channel_manager);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 window, 337 window,
336 mailbox_manager_, 338 mailbox_manager_,
337 gfx::Size(), 339 gfx::Size(),
338 disallowed_features_, 340 disallowed_features_,
339 init_params.allowed_extensions, 341 init_params.allowed_extensions,
340 init_params.attribs, 342 init_params.attribs,
341 init_params.gpu_preference, 343 init_params.gpu_preference,
342 *route_id, 344 *route_id,
343 surface_id, 345 surface_id,
344 watchdog_, 346 watchdog_,
345 software_)); 347 software_,
348 shader_cache_));
346 if (preempt_by_counter_.get()) 349 if (preempt_by_counter_.get())
347 stub->SetPreemptByCounter(preempt_by_counter_); 350 stub->SetPreemptByCounter(preempt_by_counter_);
348 router_.AddRoute(*route_id, stub.get()); 351 router_.AddRoute(*route_id, stub.get());
349 stubs_.AddWithID(stub.release(), *route_id); 352 stubs_.AddWithID(stub.release(), *route_id);
350 #endif // ENABLE_GPU 353 #endif // ENABLE_GPU
351 } 354 }
352 355
353 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { 356 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) {
354 return stubs_.Lookup(route_id); 357 return stubs_.Lookup(route_id);
355 } 358 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 share_group, 506 share_group,
504 gfx::GLSurfaceHandle(), 507 gfx::GLSurfaceHandle(),
505 mailbox_manager_.get(), 508 mailbox_manager_.get(),
506 size, 509 size,
507 disallowed_features_, 510 disallowed_features_,
508 init_params.allowed_extensions, 511 init_params.allowed_extensions,
509 init_params.attribs, 512 init_params.attribs,
510 init_params.gpu_preference, 513 init_params.gpu_preference,
511 route_id, 514 route_id,
512 0, watchdog_, 515 0, watchdog_,
513 software_)); 516 software_,
517 shader_cache_));
514 if (preempt_by_counter_.get()) 518 if (preempt_by_counter_.get())
515 stub->SetPreemptByCounter(preempt_by_counter_); 519 stub->SetPreemptByCounter(preempt_by_counter_);
516 router_.AddRoute(route_id, stub.get()); 520 router_.AddRoute(route_id, stub.get());
517 stubs_.AddWithID(stub.release(), route_id); 521 stubs_.AddWithID(stub.release(), route_id);
518 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", 522 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer",
519 "route_id", route_id); 523 "route_id", route_id);
520 #endif 524 #endif
521 525
522 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams( 526 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams(
523 reply_message, 527 reply_message,
(...skipping 14 matching lines...) Expand all
538 // In case the renderer is currently blocked waiting for a sync reply from 542 // In case the renderer is currently blocked waiting for a sync reply from
539 // the stub, we need to make sure to reschedule the GpuChannel here. 543 // the stub, we need to make sure to reschedule the GpuChannel here.
540 if (need_reschedule) 544 if (need_reschedule)
541 OnScheduled(); 545 OnScheduled();
542 } 546 }
543 547
544 if (reply_message) 548 if (reply_message)
545 Send(reply_message); 549 Send(reply_message);
546 } 550 }
547 551
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698