Chromium Code Reviews| 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 877 } | 877 } |
| 878 | 878 |
| 879 ResourceProvider::TextureHint ResourceProvider::GetTextureHint(ResourceId id) { | 879 ResourceProvider::TextureHint ResourceProvider::GetTextureHint(ResourceId id) { |
| 880 return GetResource(id)->hint; | 880 return GetResource(id)->hint; |
| 881 } | 881 } |
| 882 | 882 |
| 883 sk_sp<SkColorSpace> ResourceProvider::GetResourceSkColorSpace( | 883 sk_sp<SkColorSpace> ResourceProvider::GetResourceSkColorSpace( |
| 884 const Resource* resource) const { | 884 const Resource* resource) const { |
| 885 if (!settings_.enable_color_correct_rendering) | 885 if (!settings_.enable_color_correct_rendering) |
| 886 return nullptr; | 886 return nullptr; |
| 887 return resource->color_space.ToSkColorSpace(); | 887 return resource->color_space.ToNonlinearBlendedSkColorSpace(); |
|
enne (OOO)
2017/03/02 01:40:08
Could you leave a comment as to why we're using th
ccameron
2017/03/03 00:36:03
Done.
| |
| 888 } | 888 } |
| 889 | 889 |
| 890 void ResourceProvider::CopyToResource(ResourceId id, | 890 void ResourceProvider::CopyToResource(ResourceId id, |
| 891 const uint8_t* image, | 891 const uint8_t* image, |
| 892 const gfx::Size& image_size) { | 892 const gfx::Size& image_size) { |
| 893 Resource* resource = GetResource(id); | 893 Resource* resource = GetResource(id); |
| 894 DCHECK(!resource->locked_for_write); | 894 DCHECK(!resource->locked_for_write); |
| 895 DCHECK(!resource->lock_for_read_count); | 895 DCHECK(!resource->lock_for_read_count); |
| 896 DCHECK(resource->origin == Resource::INTERNAL); | 896 DCHECK(resource->origin == Resource::INTERNAL); |
| 897 DCHECK_EQ(resource->exported_count, 0); | 897 DCHECK_EQ(resource->exported_count, 0); |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2172 | 2172 |
| 2173 const int kImportance = 2; | 2173 const int kImportance = 2; |
| 2174 pmd->CreateSharedGlobalAllocatorDump(guid); | 2174 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 2175 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 2175 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 2176 } | 2176 } |
| 2177 | 2177 |
| 2178 return true; | 2178 return true; |
| 2179 } | 2179 } |
| 2180 | 2180 |
| 2181 } // namespace cc | 2181 } // namespace cc |
| OLD | NEW |