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

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp

Issue 2322853002: Clean up uses of SkColorSpace::GammaNamed (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 CHECK(false); 65 CHECK(false);
66 return ""; 66 return "";
67 } 67 }
68 68
69 sk_sp<SkColorSpace> CanvasRenderingContext::skColorSpace() const 69 sk_sp<SkColorSpace> CanvasRenderingContext::skColorSpace() const
70 { 70 {
71 switch (m_colorSpace) { 71 switch (m_colorSpace) {
72 case kSRGBCanvasColorSpace: 72 case kSRGBCanvasColorSpace:
73 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 73 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
74 case kLinearRGBCanvasColorSpace: 74 case kLinearRGBCanvasColorSpace:
75 { 75 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)->makeLinearGamm a();
76 // Creating a temp srgb colorspace just to get the matrix.
77 // There should be a better way
78 sk_sp<SkColorSpace> tmp = SkColorSpace::NewNamed(SkColorSpace::kSRGB _Named);
79 return SkColorSpace::NewRGB(SkColorSpace::kLinear_GammaNamed, tmp->x yz());
80 }
81 case kLegacyCanvasColorSpace: 76 case kLegacyCanvasColorSpace:
82 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { 77 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) {
83 // Legacy colorspace ensures color matching with CSS is preserved. 78 // Legacy colorspace ensures color matching with CSS is preserved.
84 // So if CSS is color corrected from sRGB to display space, then 79 // So if CSS is color corrected from sRGB to display space, then
85 // canvas must do the same 80 // canvas must do the same
86 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 81 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
87 } 82 }
88 return nullptr; 83 return nullptr;
89 }; 84 };
90 CHECK(false); 85 CHECK(false);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return taintOrigin; 147 return taintOrigin;
153 } 148 }
154 149
155 DEFINE_TRACE(CanvasRenderingContext) 150 DEFINE_TRACE(CanvasRenderingContext)
156 { 151 {
157 visitor->trace(m_canvas); 152 visitor->trace(m_canvas);
158 visitor->trace(m_offscreenCanvas); 153 visitor->trace(m_offscreenCanvas);
159 } 154 }
160 155
161 } // namespace blink 156 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698