| OLD | NEW |
| 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 "content/browser/android/in_process/context_provider_in_process.h" | 5 #include "content/browser/android/in_process/context_provider_in_process.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "cc/output/managed_memory_policy.h" | 10 #include "cc/output/managed_memory_policy.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); | 91 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); |
| 92 return true; | 92 return true; |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ContextProviderInProcess::DetachFromThread() { | 95 void ContextProviderInProcess::DetachFromThread() { |
| 96 context_thread_checker_.DetachFromThread(); | 96 context_thread_checker_.DetachFromThread(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ContextProviderInProcess::InitializeCapabilities() { | 99 void ContextProviderInProcess::InitializeCapabilities() { |
| 100 capabilities_.gpu = context3d_->GetImplementation()->capabilities(); | 100 capabilities_.gpu = context3d_->GetImplementation()->capabilities(); |
| 101 | |
| 102 size_t mapped_memory_limit = context3d_->GetMappedMemoryLimit(); | |
| 103 capabilities_.max_transfer_buffer_usage_bytes = | |
| 104 mapped_memory_limit == | |
| 105 WebGraphicsContext3DInProcessCommandBufferImpl::kNoLimit | |
| 106 ? std::numeric_limits<size_t>::max() | |
| 107 : mapped_memory_limit; | |
| 108 } | 101 } |
| 109 | 102 |
| 110 cc::ContextProvider::Capabilities | 103 cc::ContextProvider::Capabilities |
| 111 ContextProviderInProcess::ContextCapabilities() { | 104 ContextProviderInProcess::ContextCapabilities() { |
| 112 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 105 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 113 DCHECK(context_thread_checker_.CalledOnValidThread()); | 106 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 114 return capabilities_; | 107 return capabilities_; |
| 115 } | 108 } |
| 116 | 109 |
| 117 ::gpu::gles2::GLES2Interface* ContextProviderInProcess::ContextGL() { | 110 ::gpu::gles2::GLES2Interface* ContextProviderInProcess::ContextGL() { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 lost_context_callback.is_null()); | 195 lost_context_callback.is_null()); |
| 203 lost_context_callback_ = lost_context_callback; | 196 lost_context_callback_ = lost_context_callback; |
| 204 } | 197 } |
| 205 | 198 |
| 206 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( | 199 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( |
| 207 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 200 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 208 // There's no memory manager for the in-process implementation. | 201 // There's no memory manager for the in-process implementation. |
| 209 } | 202 } |
| 210 | 203 |
| 211 } // namespace content | 204 } // namespace content |
| OLD | NEW |