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

Side by Side Diff: webkit/common/gpu/context_provider_in_process.cc

Issue 455083002: Add memory limits struct to in-process context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: x64 fix attempt 2 Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "webkit/common/gpu/context_provider_in_process.h" 5 #include "webkit/common/gpu/context_provider_in_process.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 std::string unique_context_name = 103 std::string unique_context_name =
104 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); 104 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get());
105 context3d_->pushGroupMarkerEXT(unique_context_name.c_str()); 105 context3d_->pushGroupMarkerEXT(unique_context_name.c_str());
106 106
107 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); 107 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
108 return true; 108 return true;
109 } 109 }
110 110
111 void ContextProviderInProcess::InitializeCapabilities() { 111 void ContextProviderInProcess::InitializeCapabilities() {
112 capabilities_.gpu = context3d_->GetImplementation()->capabilities(); 112 capabilities_.gpu = context3d_->GetImplementation()->capabilities();
113
114 size_t mapped_memory_limit = context3d_->GetMappedMemoryLimit();
115 capabilities_.max_transfer_buffer_usage_bytes =
116 mapped_memory_limit ==
117 WebGraphicsContext3DInProcessCommandBufferImpl::kNoLimit
118 ? std::numeric_limits<size_t>::max()
119 : mapped_memory_limit;
113 } 120 }
114 121
115 cc::ContextProvider::Capabilities 122 cc::ContextProvider::Capabilities
116 ContextProviderInProcess::ContextCapabilities() { 123 ContextProviderInProcess::ContextCapabilities() {
117 DCHECK(lost_context_callback_proxy_); // Is bound to thread. 124 DCHECK(lost_context_callback_proxy_); // Is bound to thread.
118 DCHECK(context_thread_checker_.CalledOnValidThread()); 125 DCHECK(context_thread_checker_.CalledOnValidThread());
119 return capabilities_; 126 return capabilities_;
120 } 127 }
121 128
122 ::gpu::gles2::GLES2Interface* ContextProviderInProcess::ContextGL() { 129 ::gpu::gles2::GLES2Interface* ContextProviderInProcess::ContextGL() {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 lost_context_callback_ = lost_context_callback; 207 lost_context_callback_ = lost_context_callback;
201 } 208 }
202 209
203 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( 210 void ContextProviderInProcess::SetMemoryPolicyChangedCallback(
204 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { 211 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {
205 // There's no memory manager for the in-process implementation. 212 // There's no memory manager for the in-process implementation.
206 } 213 }
207 214
208 } // namespace gpu 215 } // namespace gpu
209 } // namespace webkit 216 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698