| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "cc/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 use_texture_storage_ext_(false), | 410 use_texture_storage_ext_(false), |
| 411 use_texture_format_bgra_(false), | 411 use_texture_format_bgra_(false), |
| 412 use_texture_usage_hint_(false), | 412 use_texture_usage_hint_(false), |
| 413 use_compressed_texture_etc1_(false), | 413 use_compressed_texture_etc1_(false), |
| 414 yuv_resource_format_(LUMINANCE_8), | 414 yuv_resource_format_(LUMINANCE_8), |
| 415 max_texture_size_(0), | 415 max_texture_size_(0), |
| 416 best_texture_format_(RGBA_8888), | 416 best_texture_format_(RGBA_8888), |
| 417 best_render_buffer_format_(RGBA_8888), | 417 best_render_buffer_format_(RGBA_8888), |
| 418 enable_color_correct_rendering_(enable_color_correct_rendering), | 418 enable_color_correct_rendering_(enable_color_correct_rendering), |
| 419 id_allocation_chunk_size_(id_allocation_chunk_size), | 419 id_allocation_chunk_size_(id_allocation_chunk_size), |
| 420 use_sync_query_(false), | |
| 421 buffer_to_texture_target_map_(buffer_to_texture_target_map), | 420 buffer_to_texture_target_map_(buffer_to_texture_target_map), |
| 422 tracing_id_(g_next_resource_provider_tracing_id.GetNext()) { | 421 tracing_id_(g_next_resource_provider_tracing_id.GetNext()) { |
| 423 DCHECK(id_allocation_chunk_size_); | 422 DCHECK(id_allocation_chunk_size_); |
| 424 DCHECK(thread_checker_.CalledOnValidThread()); | 423 DCHECK(thread_checker_.CalledOnValidThread()); |
| 425 | 424 |
| 426 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). | 425 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). |
| 427 // Don't register a dump provider in these cases. | 426 // Don't register a dump provider in these cases. |
| 428 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 | 427 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 |
| 429 if (base::ThreadTaskRunnerHandle::IsSet()) { | 428 if (base::ThreadTaskRunnerHandle::IsSet()) { |
| 430 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 429 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 451 use_compressed_texture_etc1_ = caps.texture_format_etc1; | 450 use_compressed_texture_etc1_ = caps.texture_format_etc1; |
| 452 | 451 |
| 453 if (caps.disable_one_component_textures) { | 452 if (caps.disable_one_component_textures) { |
| 454 yuv_resource_format_ = yuv_highbit_resource_format_ = RGBA_8888; | 453 yuv_resource_format_ = yuv_highbit_resource_format_ = RGBA_8888; |
| 455 } else { | 454 } else { |
| 456 yuv_resource_format_ = caps.texture_rg ? RED_8 : LUMINANCE_8; | 455 yuv_resource_format_ = caps.texture_rg ? RED_8 : LUMINANCE_8; |
| 457 yuv_highbit_resource_format_ = | 456 yuv_highbit_resource_format_ = |
| 458 caps.texture_half_float_linear ? LUMINANCE_F16 : yuv_resource_format_; | 457 caps.texture_half_float_linear ? LUMINANCE_F16 : yuv_resource_format_; |
| 459 } | 458 } |
| 460 | 459 |
| 461 use_sync_query_ = caps.sync_query; | |
| 462 | |
| 463 GLES2Interface* gl = ContextGL(); | 460 GLES2Interface* gl = ContextGL(); |
| 464 | 461 |
| 465 max_texture_size_ = 0; // Context expects cleared value. | 462 max_texture_size_ = 0; // Context expects cleared value. |
| 466 gl->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size_); | 463 gl->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size_); |
| 467 best_texture_format_ = | 464 best_texture_format_ = |
| 468 PlatformColor::BestSupportedTextureFormat(use_texture_format_bgra_); | 465 PlatformColor::BestSupportedTextureFormat(use_texture_format_bgra_); |
| 469 | 466 |
| 470 best_render_buffer_format_ = PlatformColor::BestSupportedTextureFormat( | 467 best_render_buffer_format_ = PlatformColor::BestSupportedTextureFormat( |
| 471 caps.render_buffer_format_bgra8888); | 468 caps.render_buffer_format_bgra8888); |
| 472 | 469 |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2059 | 2056 |
| 2060 const int kImportance = 2; | 2057 const int kImportance = 2; |
| 2061 pmd->CreateSharedGlobalAllocatorDump(guid); | 2058 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 2062 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 2059 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 2063 } | 2060 } |
| 2064 | 2061 |
| 2065 return true; | 2062 return true; |
| 2066 } | 2063 } |
| 2067 | 2064 |
| 2068 } // namespace cc | 2065 } // namespace cc |
| OLD | NEW |