| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/ImageBitmap.h" | 5 #include "core/frame/ImageBitmap.h" |
| 6 | 6 |
| 7 #include "core/html/HTMLCanvasElement.h" | 7 #include "core/html/HTMLCanvasElement.h" |
| 8 #include "core/html/HTMLVideoElement.h" | 8 #include "core/html/HTMLVideoElement.h" |
| 9 #include "core/html/ImageData.h" | 9 #include "core/html/ImageData.h" |
| 10 #include "core/offscreencanvas/OffscreenCanvas.h" | 10 #include "core/offscreencanvas/OffscreenCanvas.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } else { | 66 } else { |
| 67 parsedOptions.premultiplyAlpha = true; | 67 parsedOptions.premultiplyAlpha = true; |
| 68 DCHECK(options.premultiplyAlpha() == "default" || | 68 DCHECK(options.premultiplyAlpha() == "default" || |
| 69 options.premultiplyAlpha() == "premultiply"); | 69 options.premultiplyAlpha() == "premultiply"); |
| 70 } | 70 } |
| 71 | 71 |
| 72 if (options.colorSpaceConversion() != "none") { | 72 if (options.colorSpaceConversion() != "none") { |
| 73 if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() || | 73 if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() || |
| 74 !RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { | 74 !RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { |
| 75 DCHECK_EQ(options.colorSpaceConversion(), "default"); | 75 DCHECK_EQ(options.colorSpaceConversion(), "default"); |
| 76 // TODO(zakerinasab): Replace sRGB with a call to | |
| 77 // ImageDecoder::globalTargetColorSpace() when the crash problem on Mac | |
| 78 // is fixed. crbug.com/668546. | |
| 79 if (RuntimeEnabledFeatures::colorCorrectRenderingDefaultModeEnabled()) { | 76 if (RuntimeEnabledFeatures::colorCorrectRenderingDefaultModeEnabled()) { |
| 80 parsedOptions.dstColorSpace = | 77 parsedOptions.dstColorSpace = ColorBehavior::globalTargetColorSpace(); |
| 81 SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); | |
| 82 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; | 78 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; |
| 83 } | 79 } |
| 84 } else { | 80 } else { |
| 85 if (options.colorSpaceConversion() == "default" || | 81 if (options.colorSpaceConversion() == "default" || |
| 86 options.colorSpaceConversion() == "srgb") { | 82 options.colorSpaceConversion() == "srgb") { |
| 87 parsedOptions.dstColorSpace = | 83 parsedOptions.dstColorSpace = |
| 88 SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); | 84 SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); |
| 89 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; | 85 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; |
| 90 } else if (options.colorSpaceConversion() == "linear-rgb") { | 86 } else if (options.colorSpaceConversion() == "linear-rgb") { |
| 91 parsedOptions.dstColorSpace = | 87 parsedOptions.dstColorSpace = |
| (...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, | 1095 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, |
| 1100 FloatRect* dstRect) const {} | 1096 FloatRect* dstRect) const {} |
| 1101 | 1097 |
| 1102 FloatSize ImageBitmap::elementSize(const FloatSize&) const { | 1098 FloatSize ImageBitmap::elementSize(const FloatSize&) const { |
| 1103 return FloatSize(width(), height()); | 1099 return FloatSize(width(), height()); |
| 1104 } | 1100 } |
| 1105 | 1101 |
| 1106 DEFINE_TRACE(ImageBitmap) {} | 1102 DEFINE_TRACE(ImageBitmap) {} |
| 1107 | 1103 |
| 1108 } // namespace blink | 1104 } // namespace blink |
| OLD | NEW |