Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: cc/resources/resource_provider.cc

Issue 2727063002: cc: Specify rasterization color space (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | ui/gfx/color_space.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | ui/gfx/color_space.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698