| OLD | NEW |
| 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 Loading... |
| 65 case kLegacyCanvasColorSpace: | 65 case kLegacyCanvasColorSpace: |
| 66 return kLegacyCanvasColorSpaceName; | 66 return kLegacyCanvasColorSpaceName; |
| 67 }; | 67 }; |
| 68 CHECK(false); | 68 CHECK(false); |
| 69 return ""; | 69 return ""; |
| 70 } | 70 } |
| 71 | 71 |
| 72 sk_sp<SkColorSpace> CanvasRenderingContext::skColorSpace() const { | 72 sk_sp<SkColorSpace> CanvasRenderingContext::skColorSpace() const { |
| 73 switch (m_colorSpace) { | 73 switch (m_colorSpace) { |
| 74 case kSRGBCanvasColorSpace: | 74 case kSRGBCanvasColorSpace: |
| 75 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 75 return SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); |
| 76 case kLinearRGBCanvasColorSpace: | 76 case kLinearRGBCanvasColorSpace: |
| 77 return SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Named); | 77 return SkColorSpace::MakeNamed(SkColorSpace::kSRGBLinear_Named); |
| 78 case kLegacyCanvasColorSpace: | 78 case kLegacyCanvasColorSpace: |
| 79 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { | 79 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { |
| 80 // Legacy colorspace ensures color matching with CSS is preserved. | 80 // Legacy colorspace ensures color matching with CSS is preserved. |
| 81 // So if CSS is color corrected from sRGB to display space, then | 81 // So if CSS is color corrected from sRGB to display space, then |
| 82 // canvas must do the same | 82 // canvas must do the same |
| 83 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 83 return SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); |
| 84 } | 84 } |
| 85 return nullptr; | 85 return nullptr; |
| 86 }; | 86 }; |
| 87 CHECK(false); | 87 CHECK(false); |
| 88 return nullptr; | 88 return nullptr; |
| 89 } | 89 } |
| 90 | 90 |
| 91 SkColorType CanvasRenderingContext::colorType() const { | 91 SkColorType CanvasRenderingContext::colorType() const { |
| 92 switch (m_colorSpace) { | 92 switch (m_colorSpace) { |
| 93 case kLinearRGBCanvasColorSpace: | 93 case kLinearRGBCanvasColorSpace: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 return taintOrigin; | 164 return taintOrigin; |
| 165 } | 165 } |
| 166 | 166 |
| 167 DEFINE_TRACE(CanvasRenderingContext) { | 167 DEFINE_TRACE(CanvasRenderingContext) { |
| 168 visitor->trace(m_canvas); | 168 visitor->trace(m_canvas); |
| 169 visitor->trace(m_offscreenCanvas); | 169 visitor->trace(m_offscreenCanvas); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace blink | 172 } // namespace blink |
| OLD | NEW |