| 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 26 matching lines...) Expand all Loading... |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 CanvasRenderingContext::CanvasRenderingContext( | 39 CanvasRenderingContext::CanvasRenderingContext( |
| 40 HTMLCanvasElement* canvas, | 40 HTMLCanvasElement* canvas, |
| 41 OffscreenCanvas* offscreenCanvas, | 41 OffscreenCanvas* offscreenCanvas, |
| 42 const CanvasContextCreationAttributes& attrs) | 42 const CanvasContextCreationAttributes& attrs) |
| 43 : m_canvas(canvas), | 43 : m_canvas(canvas), |
| 44 m_offscreenCanvas(offscreenCanvas), | 44 m_offscreenCanvas(offscreenCanvas), |
| 45 m_colorSpace(kLegacyCanvasColorSpace), | 45 m_colorSpace(kLegacyCanvasColorSpace), |
| 46 m_creationAttributes(attrs) { | 46 m_creationAttributes(attrs) { |
| 47 if (RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled()) { | 47 if (RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() && |
| 48 RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { |
| 48 if (m_creationAttributes.colorSpace() == kSRGBCanvasColorSpaceName) | 49 if (m_creationAttributes.colorSpace() == kSRGBCanvasColorSpaceName) |
| 49 m_colorSpace = kSRGBCanvasColorSpace; | 50 m_colorSpace = kSRGBCanvasColorSpace; |
| 50 else if (m_creationAttributes.colorSpace() == | 51 else if (m_creationAttributes.colorSpace() == |
| 51 kLinearRGBCanvasColorSpaceName) | 52 kLinearRGBCanvasColorSpaceName) |
| 52 m_colorSpace = kLinearRGBCanvasColorSpace; | 53 m_colorSpace = kLinearRGBCanvasColorSpace; |
| 53 } | 54 } |
| 54 // Make m_creationAttributes reflect the effective colorSpace rather than the | 55 // Make m_creationAttributes reflect the effective colorSpace rather than the |
| 55 // requested one | 56 // requested one |
| 56 m_creationAttributes.setColorSpace(colorSpaceAsString()); | 57 m_creationAttributes.setColorSpace(colorSpaceAsString()); |
| 57 } | 58 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 164 } |
| 164 return taintOrigin; | 165 return taintOrigin; |
| 165 } | 166 } |
| 166 | 167 |
| 167 DEFINE_TRACE(CanvasRenderingContext) { | 168 DEFINE_TRACE(CanvasRenderingContext) { |
| 168 visitor->trace(m_canvas); | 169 visitor->trace(m_canvas); |
| 169 visitor->trace(m_offscreenCanvas); | 170 visitor->trace(m_offscreenCanvas); |
| 170 } | 171 } |
| 171 | 172 |
| 172 } // namespace blink | 173 } // namespace blink |
| OLD | NEW |