| 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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 GLenum ResourceProvider::GetResourceTextureTarget(ResourceId id) { | 818 GLenum ResourceProvider::GetResourceTextureTarget(ResourceId id) { |
| 819 return GetResource(id)->target; | 819 return GetResource(id)->target; |
| 820 } | 820 } |
| 821 | 821 |
| 822 ResourceProvider::TextureHint ResourceProvider::GetTextureHint(ResourceId id) { | 822 ResourceProvider::TextureHint ResourceProvider::GetTextureHint(ResourceId id) { |
| 823 return GetResource(id)->hint; | 823 return GetResource(id)->hint; |
| 824 } | 824 } |
| 825 | 825 |
| 826 sk_sp<SkColorSpace> ResourceProvider::GetResourceSkColorSpace( | 826 sk_sp<SkColorSpace> ResourceProvider::GetResourceSkColorSpace( |
| 827 const Resource* resource) const { | 827 const Resource* resource) const { |
| 828 // TODO(crbug.com/634102): Implement conversion for skia-based compositing to | 828 if (!enable_color_correct_rendering_) |
| 829 // be color-managed | 829 return nullptr; |
| 830 return nullptr; | 830 return resource->color_space.ToSkColorSpace(); |
| 831 } | 831 } |
| 832 | 832 |
| 833 void ResourceProvider::CopyToResource(ResourceId id, | 833 void ResourceProvider::CopyToResource(ResourceId id, |
| 834 const uint8_t* image, | 834 const uint8_t* image, |
| 835 const gfx::Size& image_size) { | 835 const gfx::Size& image_size) { |
| 836 Resource* resource = GetResource(id); | 836 Resource* resource = GetResource(id); |
| 837 DCHECK(!resource->locked_for_write); | 837 DCHECK(!resource->locked_for_write); |
| 838 DCHECK(!resource->lock_for_read_count); | 838 DCHECK(!resource->lock_for_read_count); |
| 839 DCHECK(resource->origin == Resource::INTERNAL); | 839 DCHECK(resource->origin == Resource::INTERNAL); |
| 840 DCHECK_EQ(resource->exported_count, 0); | 840 DCHECK_EQ(resource->exported_count, 0); |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 | 2039 |
| 2040 const int kImportance = 2; | 2040 const int kImportance = 2; |
| 2041 pmd->CreateSharedGlobalAllocatorDump(guid); | 2041 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 2042 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 2042 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 2043 } | 2043 } |
| 2044 | 2044 |
| 2045 return true; | 2045 return true; |
| 2046 } | 2046 } |
| 2047 | 2047 |
| 2048 } // namespace cc | 2048 } // namespace cc |
| OLD | NEW |