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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 | 1241 |
1242 DCHECK(IsGpuResourceType(default_resource_type_)); | 1242 DCHECK(IsGpuResourceType(default_resource_type_)); |
1243 use_texture_storage_ext_ = caps.gpu.texture_storage; | 1243 use_texture_storage_ext_ = caps.gpu.texture_storage; |
1244 use_texture_format_bgra_ = caps.gpu.texture_format_bgra8888; | 1244 use_texture_format_bgra_ = caps.gpu.texture_format_bgra8888; |
1245 use_texture_usage_hint_ = caps.gpu.texture_usage; | 1245 use_texture_usage_hint_ = caps.gpu.texture_usage; |
1246 use_compressed_texture_etc1_ = caps.gpu.texture_format_etc1; | 1246 use_compressed_texture_etc1_ = caps.gpu.texture_format_etc1; |
1247 yuv_resource_format_ = caps.gpu.texture_rg ? RED_8 : LUMINANCE_8; | 1247 yuv_resource_format_ = caps.gpu.texture_rg ? RED_8 : LUMINANCE_8; |
1248 yuv_highbit_resource_format_ = yuv_resource_format_; | 1248 yuv_highbit_resource_format_ = yuv_resource_format_; |
1249 if (caps.gpu.texture_half_float_linear) | 1249 if (caps.gpu.texture_half_float_linear) |
1250 yuv_highbit_resource_format_ = LUMINANCE_F16; | 1250 yuv_highbit_resource_format_ = LUMINANCE_F16; |
| 1251 if (caps.gpu.avoid_one_component_egl_images) { |
| 1252 yuv_resource_format_ = yuv_highbit_resource_format_ = RGBA_8888; |
| 1253 } |
1251 use_sync_query_ = caps.gpu.sync_query; | 1254 use_sync_query_ = caps.gpu.sync_query; |
1252 | 1255 |
1253 max_texture_size_ = 0; // Context expects cleared value. | 1256 max_texture_size_ = 0; // Context expects cleared value. |
1254 gl->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size_); | 1257 gl->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size_); |
1255 best_texture_format_ = | 1258 best_texture_format_ = |
1256 PlatformColor::BestSupportedTextureFormat(use_texture_format_bgra_); | 1259 PlatformColor::BestSupportedTextureFormat(use_texture_format_bgra_); |
1257 | 1260 |
1258 best_render_buffer_format_ = PlatformColor::BestSupportedTextureFormat( | 1261 best_render_buffer_format_ = PlatformColor::BestSupportedTextureFormat( |
1259 caps.gpu.render_buffer_format_bgra8888); | 1262 caps.gpu.render_buffer_format_bgra8888); |
1260 | 1263 |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 | 1962 |
1960 const int kImportance = 2; | 1963 const int kImportance = 2; |
1961 pmd->CreateSharedGlobalAllocatorDump(guid); | 1964 pmd->CreateSharedGlobalAllocatorDump(guid); |
1962 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1965 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
1963 } | 1966 } |
1964 | 1967 |
1965 return true; | 1968 return true; |
1966 } | 1969 } |
1967 | 1970 |
1968 } // namespace cc | 1971 } // namespace cc |
OLD | NEW |