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

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: tiny fix for android and windows build 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 scoped_refptr<gpu::RefCountedCounter> unprocessed_messages_; 140 scoped_refptr<gpu::RefCountedCounter> unprocessed_messages_;
141 }; 141 };
142 142
143 } // anonymous namespace 143 } // anonymous namespace
144 144
145 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, 145 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
146 GpuWatchdog* watchdog, 146 GpuWatchdog* watchdog,
147 gfx::GLShareGroup* share_group, 147 gfx::GLShareGroup* share_group,
148 gpu::gles2::MailboxManager* mailbox, 148 gpu::gles2::MailboxManager* mailbox,
149 int client_id, 149 int client_id,
150 bool software) 150 bool software,
151 gpu::gles2::ProgramCache* program_cache)
151 : gpu_channel_manager_(gpu_channel_manager), 152 : gpu_channel_manager_(gpu_channel_manager),
153 program_cache_(program_cache),
152 unprocessed_messages_(new gpu::RefCountedCounter), 154 unprocessed_messages_(new gpu::RefCountedCounter),
153 client_id_(client_id), 155 client_id_(client_id),
154 share_group_(share_group ? share_group : new gfx::GLShareGroup), 156 share_group_(share_group ? share_group : new gfx::GLShareGroup),
155 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager), 157 mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager),
156 watchdog_(watchdog), 158 watchdog_(watchdog),
157 software_(software), 159 software_(software),
158 handle_messages_scheduled_(false), 160 handle_messages_scheduled_(false),
159 processed_get_state_fast_(false), 161 processed_get_state_fast_(false),
160 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 162 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
161 DCHECK(gpu_channel_manager); 163 DCHECK(gpu_channel_manager);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 mailbox_manager_, 327 mailbox_manager_,
326 gfx::Size(), 328 gfx::Size(),
327 disallowed_features_, 329 disallowed_features_,
328 init_params.allowed_extensions, 330 init_params.allowed_extensions,
329 init_params.attribs, 331 init_params.attribs,
330 init_params.gpu_preference, 332 init_params.gpu_preference,
331 *route_id, 333 *route_id,
332 surface_id, 334 surface_id,
333 watchdog_, 335 watchdog_,
334 software_, 336 software_,
335 init_params.active_url)); 337 init_params.active_url,
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 gfx::GLSurfaceHandle(), 479 gfx::GLSurfaceHandle(),
477 mailbox_manager_.get(), 480 mailbox_manager_.get(),
478 size, 481 size,
479 disallowed_features_, 482 disallowed_features_,
480 init_params.allowed_extensions, 483 init_params.allowed_extensions,
481 init_params.attribs, 484 init_params.attribs,
482 init_params.gpu_preference, 485 init_params.gpu_preference,
483 route_id, 486 route_id,
484 0, watchdog_, 487 0, watchdog_,
485 software_, 488 software_,
486 init_params.active_url)); 489 init_params.active_url,
490 program_cache_));
487 if (preempt_by_counter_.get()) 491 if (preempt_by_counter_.get())
488 stub->SetPreemptByCounter(preempt_by_counter_); 492 stub->SetPreemptByCounter(preempt_by_counter_);
489 router_.AddRoute(route_id, stub.get()); 493 router_.AddRoute(route_id, stub.get());
490 stubs_.AddWithID(stub.release(), route_id); 494 stubs_.AddWithID(stub.release(), route_id);
491 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", 495 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer",
492 "route_id", route_id); 496 "route_id", route_id);
493 #endif 497 #endif
494 498
495 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams( 499 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams(
496 reply_message, 500 reply_message,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 } 534 }
531 535
532 void GpuChannel::OnEstablishStreamTexture( 536 void GpuChannel::OnEstablishStreamTexture(
533 int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type, 537 int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type,
534 int32 primary_id, int32 secondary_id) { 538 int32 primary_id, int32 secondary_id) {
535 stream_texture_manager_->EstablishStreamTexture( 539 stream_texture_manager_->EstablishStreamTexture(
536 stream_id, type, primary_id, secondary_id); 540 stream_id, type, primary_id, secondary_id);
537 } 541 }
538 #endif 542 #endif
539 543
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698