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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.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(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 gpu::gles2::MailboxManager* mailbox_manager, 72 gpu::gles2::MailboxManager* mailbox_manager,
73 const gfx::Size& size, 73 const gfx::Size& size,
74 const gpu::gles2::DisallowedFeatures& disallowed_features, 74 const gpu::gles2::DisallowedFeatures& disallowed_features,
75 const std::string& allowed_extensions, 75 const std::string& allowed_extensions,
76 const std::vector<int32>& attribs, 76 const std::vector<int32>& attribs,
77 gfx::GpuPreference gpu_preference, 77 gfx::GpuPreference gpu_preference,
78 int32 route_id, 78 int32 route_id,
79 int32 surface_id, 79 int32 surface_id,
80 GpuWatchdog* watchdog, 80 GpuWatchdog* watchdog,
81 bool software, 81 bool software,
82 const GURL& active_url) 82 const GURL& active_url,
83 gpu::gles2::ProgramCache* program_cache)
83 : channel_(channel), 84 : channel_(channel),
84 handle_(handle), 85 handle_(handle),
85 initial_size_(size), 86 initial_size_(size),
86 disallowed_features_(disallowed_features), 87 disallowed_features_(disallowed_features),
87 allowed_extensions_(allowed_extensions), 88 allowed_extensions_(allowed_extensions),
88 requested_attribs_(attribs), 89 requested_attribs_(attribs),
89 gpu_preference_(gpu_preference), 90 gpu_preference_(gpu_preference),
90 route_id_(route_id), 91 route_id_(route_id),
91 software_(software), 92 software_(software),
92 client_has_memory_allocation_changed_callback_(false), 93 client_has_memory_allocation_changed_callback_(false),
93 last_flush_count_(0), 94 last_flush_count_(0),
94 parent_stub_for_initialization_(), 95 parent_stub_for_initialization_(),
95 parent_texture_for_initialization_(0), 96 parent_texture_for_initialization_(0),
96 watchdog_(watchdog), 97 watchdog_(watchdog),
97 sync_point_wait_count_(0), 98 sync_point_wait_count_(0),
98 delayed_work_scheduled_(false), 99 delayed_work_scheduled_(false),
99 active_url_(active_url) { 100 active_url_(active_url) {
100 active_url_hash_ = 101 active_url_hash_ =
101 disk_cache::Hash(active_url.possibly_invalid_spec()); 102 disk_cache::Hash(active_url.possibly_invalid_spec());
102 FastSetActiveURL(active_url_, active_url_hash_); 103 FastSetActiveURL(active_url_, active_url_hash_);
103 if (share_group) { 104 if (share_group) {
104 context_group_ = share_group->context_group_; 105 context_group_ = share_group->context_group_;
105 } else { 106 } else {
106 context_group_ = new gpu::gles2::ContextGroup(mailbox_manager, true); 107 context_group_ = new gpu::gles2::ContextGroup(mailbox_manager,
108 true,
109 program_cache);
107 } 110 }
108 if (surface_id != 0) 111 if (surface_id != 0)
109 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState( 112 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState(
110 surface_id, true, base::TimeTicks::Now())); 113 surface_id, true, base::TimeTicks::Now()));
111 if (handle_.sync_point) 114 if (handle_.sync_point)
112 OnWaitSyncPoint(handle_.sync_point); 115 OnWaitSyncPoint(handle_.sync_point);
113 } 116 }
114 117
115 GpuCommandBufferStub::~GpuCommandBufferStub() { 118 GpuCommandBufferStub::~GpuCommandBufferStub() {
116 Destroy(); 119 Destroy();
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 const GpuMemoryAllocation& allocation) { 800 const GpuMemoryAllocation& allocation) {
798 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); 801 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation));
799 // This can be called outside of OnMessageReceived, so the context needs to be 802 // This can be called outside of OnMessageReceived, so the context needs to be
800 // made current before calling methods on the surface. 803 // made current before calling methods on the surface.
801 if (!surface_ || !MakeCurrent()) 804 if (!surface_ || !MakeCurrent())
802 return; 805 return;
803 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); 806 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer);
804 } 807 }
805 808
806 #endif // defined(ENABLE_GPU) 809 #endif // defined(ENABLE_GPU)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698