| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 { |
| 76 // Creating a temp srgb colorspace just to get the matrix. | 76 // Creating a temp srgb colorspace just to get the matrix. |
| 77 // There should be a better way | 77 // There should be a better way |
| 78 sk_sp<SkColorSpace> tmp = SkColorSpace::NewNamed(SkColorSpace::kSRGB
_Named); | 78 sk_sp<SkColorSpace> tmp = SkColorSpace::NewNamed(SkColorSpace::kSRGB
_Named); |
| 79 return SkColorSpace::NewRGB(SkColorSpace::kLinear_GammaNamed, tmp->x
yz()); | 79 return SkColorSpace::NewRGB(SkColorSpace::kLinear_GammaNamed, tmp->x
yz()); |
| 80 } | 80 } |
| 81 case kLegacyCanvasColorSpace: | 81 case kLegacyCanvasColorSpace: |
| 82 // TODO(crbug.com/637381): To uncomment the following block of code we n
eed | |
| 83 // it to not cause a bunch of test failures. | |
| 84 /* | |
| 85 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { | 82 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { |
| 86 // Legacy colorspace ensures color matching with CSS is preserved. | 83 // Legacy colorspace ensures color matching with CSS is preserved. |
| 87 // So if CSS is color corrected from sRGB to display space, then | 84 // So if CSS is color corrected from sRGB to display space, then |
| 88 // canvas must do the same | 85 // canvas must do the same |
| 89 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 86 return SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
| 90 } | 87 } |
| 91 */ | |
| 92 return nullptr; | 88 return nullptr; |
| 93 }; | 89 }; |
| 94 CHECK(false); | 90 CHECK(false); |
| 95 return nullptr; | 91 return nullptr; |
| 96 } | 92 } |
| 97 | 93 |
| 98 void CanvasRenderingContext::dispose() | 94 void CanvasRenderingContext::dispose() |
| 99 { | 95 { |
| 100 // HTMLCanvasElement and CanvasRenderingContext have a circular reference. | 96 // HTMLCanvasElement and CanvasRenderingContext have a circular reference. |
| 101 // When the pair is no longer reachable, their destruction order is non- | 97 // When the pair is no longer reachable, their destruction order is non- |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return taintOrigin; | 152 return taintOrigin; |
| 157 } | 153 } |
| 158 | 154 |
| 159 DEFINE_TRACE(CanvasRenderingContext) | 155 DEFINE_TRACE(CanvasRenderingContext) |
| 160 { | 156 { |
| 161 visitor->trace(m_canvas); | 157 visitor->trace(m_canvas); |
| 162 visitor->trace(m_offscreenCanvas); | 158 visitor->trace(m_offscreenCanvas); |
| 163 } | 159 } |
| 164 | 160 |
| 165 } // namespace blink | 161 } // namespace blink |
| OLD | NEW |