| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 parsedOptions.premultiplyAlpha = true; | 75 parsedOptions.premultiplyAlpha = true; |
| 76 DCHECK(options.premultiplyAlpha() == kImageBitmapOptionDefault || | 76 DCHECK(options.premultiplyAlpha() == kImageBitmapOptionDefault || |
| 77 options.premultiplyAlpha() == kImageBitmapOptionPremultiply); | 77 options.premultiplyAlpha() == kImageBitmapOptionPremultiply); |
| 78 } | 78 } |
| 79 | 79 |
| 80 if (options.colorSpaceConversion() != kImageBitmapOptionNone) { | 80 if (options.colorSpaceConversion() != kImageBitmapOptionNone) { |
| 81 if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() || | 81 if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() || |
| 82 !RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { | 82 !RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { |
| 83 DCHECK_EQ(options.colorSpaceConversion(), kImageBitmapOptionDefault); | 83 DCHECK_EQ(options.colorSpaceConversion(), kImageBitmapOptionDefault); |
| 84 if (RuntimeEnabledFeatures::colorCorrectRenderingDefaultModeEnabled()) { | 84 if (RuntimeEnabledFeatures::colorCorrectRenderingDefaultModeEnabled()) { |
| 85 parsedOptions.dstColorSpace = ColorBehavior::globalTargetColorSpace(); | 85 parsedOptions.dstColorSpace = |
| 86 ColorBehavior::globalTargetColorSpace().ToSkColorSpace(); |
| 86 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; | 87 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; |
| 87 } | 88 } |
| 88 } else { | 89 } else { |
| 89 if (options.colorSpaceConversion() == kImageBitmapOptionDefault || | 90 if (options.colorSpaceConversion() == kImageBitmapOptionDefault || |
| 90 options.colorSpaceConversion() == | 91 options.colorSpaceConversion() == |
| 91 kSRGBImageBitmapColorSpaceConversion) { | 92 kSRGBImageBitmapColorSpaceConversion) { |
| 92 parsedOptions.dstColorSpace = | 93 parsedOptions.dstColorSpace = |
| 93 SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); | 94 SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); |
| 94 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; | 95 parsedOptions.dstColorType = SkColorType::kN32_SkColorType; |
| 95 } else if (options.colorSpaceConversion() == | 96 } else if (options.colorSpaceConversion() == |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, | 1154 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, |
| 1154 FloatRect* dstRect) const {} | 1155 FloatRect* dstRect) const {} |
| 1155 | 1156 |
| 1156 FloatSize ImageBitmap::elementSize(const FloatSize&) const { | 1157 FloatSize ImageBitmap::elementSize(const FloatSize&) const { |
| 1157 return FloatSize(width(), height()); | 1158 return FloatSize(width(), height()); |
| 1158 } | 1159 } |
| 1159 | 1160 |
| 1160 DEFINE_TRACE(ImageBitmap) {} | 1161 DEFINE_TRACE(ImageBitmap) {} |
| 1161 | 1162 |
| 1162 } // namespace blink | 1163 } // namespace blink |
| OLD | NEW |