| 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/html/canvas/CanvasRenderingContext.h" | 26 #include "core/html/canvas/CanvasRenderingContext.h" |
| 27 | 27 |
| 28 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 28 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
| 29 #include "core/html/canvas/CanvasImageSource.h" | 29 #include "core/html/canvas/CanvasImageSource.h" |
| 30 #include "platform/RuntimeEnabledFeatures.h" | 30 #include "platform/RuntimeEnabledFeatures.h" |
| 31 #include "platform/weborigin/SecurityOrigin.h" | 31 #include "platform/weborigin/SecurityOrigin.h" |
| 32 #include "public/platform/Platform.h" | 32 #include "public/platform/Platform.h" |
| 33 | 33 |
| 34 constexpr const char* kLegacyCanvasColorSpaceName = "legacy-srgb"; | |
| 35 constexpr const char* kSRGBCanvasColorSpaceName = "srgb"; | |
| 36 constexpr const char* kRec2020CanvasColorSpaceName = "rec2020"; | |
| 37 constexpr const char* kP3CanvasColorSpaceName = "p3"; | |
| 38 | |
| 39 constexpr const char* kRGBA8CanvasPixelFormatName = "8-8-8-8"; | |
| 40 constexpr const char* kRGB10A2CanvasPixelFormatName = "10-10-10-2"; | |
| 41 constexpr const char* kRGBA12CanvasPixelFormatName = "12-12-12-12"; | |
| 42 constexpr const char* kF16CanvasPixelFormatName = "float16"; | |
| 43 | |
| 44 namespace blink { | 34 namespace blink { |
| 45 | 35 |
| 46 CanvasRenderingContext::CanvasRenderingContext( | 36 CanvasRenderingContext::CanvasRenderingContext( |
| 47 HTMLCanvasElement* canvas, | 37 HTMLCanvasElement* canvas, |
| 48 OffscreenCanvas* offscreenCanvas, | 38 OffscreenCanvas* offscreenCanvas, |
| 49 const CanvasContextCreationAttributes& attrs) | 39 const CanvasContextCreationAttributes& attrs) |
| 50 : m_canvas(canvas), | 40 : m_canvas(canvas), |
| 51 m_offscreenCanvas(offscreenCanvas), | 41 m_offscreenCanvas(offscreenCanvas), |
| 52 m_colorSpace(kLegacyCanvasColorSpace), | 42 m_colorSpace(kLegacyCanvasColorSpace), |
| 53 m_pixelFormat(kRGBA8CanvasPixelFormat), | 43 m_pixelFormat(kRGBA8CanvasPixelFormat), |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 235 } |
| 246 return taintOrigin; | 236 return taintOrigin; |
| 247 } | 237 } |
| 248 | 238 |
| 249 DEFINE_TRACE(CanvasRenderingContext) { | 239 DEFINE_TRACE(CanvasRenderingContext) { |
| 250 visitor->trace(m_canvas); | 240 visitor->trace(m_canvas); |
| 251 visitor->trace(m_offscreenCanvas); | 241 visitor->trace(m_offscreenCanvas); |
| 252 } | 242 } |
| 253 | 243 |
| 254 } // namespace blink | 244 } // namespace blink |
| OLD | NEW |