| 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/Float32ImageData.h" | 7 #include "core/html/Float32ImageData.h" |
| 8 #include "core/html/HTMLCanvasElement.h" | 8 #include "core/html/HTMLCanvasElement.h" |
| 9 #include "core/html/HTMLVideoElement.h" | 9 #include "core/html/HTMLVideoElement.h" |
| 10 #include "core/html/ImageData.h" | 10 #include "core/html/ImageData.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 DCHECK_EQ(options.colorSpaceConversion(), kImageBitmapOptionDefault); | 83 DCHECK_EQ(options.colorSpaceConversion(), kImageBitmapOptionDefault); |
| 84 if (RuntimeEnabledFeatures::colorCorrectRenderingDefaultModeEnabled()) { | 84 if (RuntimeEnabledFeatures::colorCorrectRenderingDefaultModeEnabled()) { |
| 85 parsedOptions.dstColorSpace = | 85 parsedOptions.dstColorSpace = |
| 86 ColorBehavior::globalTargetColorSpace().ToSkColorSpace(); | 86 ColorBehavior::globalTargetColorSpace().ToSkColorSpace(); |
| 87 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; | 87 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; |
| 88 } | 88 } |
| 89 } else { | 89 } else { |
| 90 if (options.colorSpaceConversion() == kImageBitmapOptionDefault || | 90 if (options.colorSpaceConversion() == kImageBitmapOptionDefault || |
| 91 options.colorSpaceConversion() == | 91 options.colorSpaceConversion() == |
| 92 kSRGBImageBitmapColorSpaceConversion) { | 92 kSRGBImageBitmapColorSpaceConversion) { |
| 93 parsedOptions.dstColorSpace = | 93 parsedOptions.dstColorSpace = SkColorSpace::MakeSRGB(); |
| 94 SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); | |
| 95 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; | 94 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; |
| 96 } else if (options.colorSpaceConversion() == | 95 } else if (options.colorSpaceConversion() == |
| 97 kLinearRGBImageBitmapColorSpaceConversion) { | 96 kLinearRGBImageBitmapColorSpaceConversion) { |
| 98 parsedOptions.dstColorSpace = | 97 parsedOptions.dstColorSpace = SkColorSpace::MakeSRGBLinear(); |
| 99 SkColorSpace::MakeNamed(SkColorSpace::kSRGBLinear_Named); | |
| 100 parsedOptions.dstColorType = SkColorType::kRGBA_F16_SkColorType; | 98 parsedOptions.dstColorType = SkColorType::kRGBA_F16_SkColorType; |
| 101 } else { | 99 } else { |
| 102 NOTREACHED() | 100 NOTREACHED() |
| 103 << "Invalid ImageBitmap creation attribute colorSpaceConversion: " | 101 << "Invalid ImageBitmap creation attribute colorSpaceConversion: " |
| 104 << options.colorSpaceConversion(); | 102 << options.colorSpaceConversion(); |
| 105 } | 103 } |
| 106 } | 104 } |
| 107 } | 105 } |
| 108 | 106 |
| 109 int sourceWidth = sourceSize.width(); | 107 int sourceWidth = sourceSize.width(); |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, | 1152 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, |
| 1155 FloatRect* dstRect) const {} | 1153 FloatRect* dstRect) const {} |
| 1156 | 1154 |
| 1157 FloatSize ImageBitmap::elementSize(const FloatSize&) const { | 1155 FloatSize ImageBitmap::elementSize(const FloatSize&) const { |
| 1158 return FloatSize(width(), height()); | 1156 return FloatSize(width(), height()); |
| 1159 } | 1157 } |
| 1160 | 1158 |
| 1161 DEFINE_TRACE(ImageBitmap) {} | 1159 DEFINE_TRACE(ImageBitmap) {} |
| 1162 | 1160 |
| 1163 } // namespace blink | 1161 } // namespace blink |
| OLD | NEW |