| 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/common/gpu/client/context_provider_command_buffer.h" | 5 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 extension_set.count("GL_EXT_texture_format_BGRA8888") > 0; | 257 extension_set.count("GL_EXT_texture_format_BGRA8888") > 0; |
| 258 caps.texture_rectangle = extension_set.count("GL_ARB_texture_rectangle") > 0; | 258 caps.texture_rectangle = extension_set.count("GL_ARB_texture_rectangle") > 0; |
| 259 | 259 |
| 260 // TODO(jamesr): This is unconditionally true on mac, no need to test for it | 260 // TODO(jamesr): This is unconditionally true on mac, no need to test for it |
| 261 // at runtime. | 261 // at runtime. |
| 262 caps.iosurface = extension_set.count("GL_CHROMIUM_iosurface") > 0; | 262 caps.iosurface = extension_set.count("GL_CHROMIUM_iosurface") > 0; |
| 263 | 263 |
| 264 caps.texture_usage = extension_set.count("GL_ANGLE_texture_usage") > 0; | 264 caps.texture_usage = extension_set.count("GL_ANGLE_texture_usage") > 0; |
| 265 caps.texture_storage = extension_set.count("GL_EXT_texture_storage") > 0; | 265 caps.texture_storage = extension_set.count("GL_EXT_texture_storage") > 0; |
| 266 | 266 |
| 267 size_t mapped_memory_limit = context3d_->GetMappedMemoryLimit(); |
| 268 caps.max_transfer_buffer_usage_bytes = |
| 269 mapped_memory_limit == WebGraphicsContext3DCommandBufferImpl::kNoLimit |
| 270 ? std::numeric_limits<size_t>::max() : mapped_memory_limit; |
| 271 |
| 267 capabilities_ = caps; | 272 capabilities_ = caps; |
| 268 } | 273 } |
| 269 | 274 |
| 270 | 275 |
| 271 bool ContextProviderCommandBuffer::DestroyedOnMainThread() { | 276 bool ContextProviderCommandBuffer::DestroyedOnMainThread() { |
| 272 DCHECK(main_thread_checker_.CalledOnValidThread()); | 277 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 273 | 278 |
| 274 base::AutoLock lock(main_thread_lock_); | 279 base::AutoLock lock(main_thread_lock_); |
| 275 return destroyed_; | 280 return destroyed_; |
| 276 } | 281 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 293 | 298 |
| 294 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( | 299 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( |
| 295 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 300 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 296 DCHECK(context_thread_checker_.CalledOnValidThread()); | 301 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 297 DCHECK(memory_policy_changed_callback_.is_null() || | 302 DCHECK(memory_policy_changed_callback_.is_null() || |
| 298 memory_policy_changed_callback.is_null()); | 303 memory_policy_changed_callback.is_null()); |
| 299 memory_policy_changed_callback_ = memory_policy_changed_callback; | 304 memory_policy_changed_callback_ = memory_policy_changed_callback; |
| 300 } | 305 } |
| 301 | 306 |
| 302 } // namespace content | 307 } // namespace content |
| OLD | NEW |