| 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 "platform/image-decoders/ImageDecoder.h" | 10 #include "platform/image-decoders/ImageDecoder.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 { | 422 { |
| 423 if (options.imageOrientation() == imageOrientationFlipY) { | 423 if (options.imageOrientation() == imageOrientationFlipY) { |
| 424 flipY = true; | 424 flipY = true; |
| 425 } else { | 425 } else { |
| 426 flipY = false; | 426 flipY = false; |
| 427 ASSERT(options.imageOrientation() == imageBitmapOptionNone); | 427 ASSERT(options.imageOrientation() == imageBitmapOptionNone); |
| 428 } | 428 } |
| 429 if (options.premultiplyAlpha() == imageBitmapOptionNone) { | 429 if (options.premultiplyAlpha() == imageBitmapOptionNone) { |
| 430 m_isPremultiplied = false; | 430 m_isPremultiplied = false; |
| 431 } else { | 431 } else { |
| 432 ASSERT(options.premultiplyAlpha() == "default"); | 432 ASSERT(options.premultiplyAlpha() == "default" || options.premultiplyAlp
ha() == "premultiply"); |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 | 435 |
| 436 PassRefPtr<Image> ImageBitmap::getSourceImageForCanvas(SourceImageStatus* status
, AccelerationHint, SnapshotReason) const | 436 PassRefPtr<Image> ImageBitmap::getSourceImageForCanvas(SourceImageStatus* status
, AccelerationHint, SnapshotReason) const |
| 437 { | 437 { |
| 438 *status = NormalSourceImageStatus; | 438 *status = NormalSourceImageStatus; |
| 439 return m_image ? m_image : nullptr; | 439 return m_image ? m_image : nullptr; |
| 440 } | 440 } |
| 441 | 441 |
| 442 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const | 442 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const |
| 443 { | 443 { |
| 444 } | 444 } |
| 445 | 445 |
| 446 FloatSize ImageBitmap::elementSize() const | 446 FloatSize ImageBitmap::elementSize() const |
| 447 { | 447 { |
| 448 return FloatSize(width(), height()); | 448 return FloatSize(width(), height()); |
| 449 } | 449 } |
| 450 | 450 |
| 451 DEFINE_TRACE(ImageBitmap) | 451 DEFINE_TRACE(ImageBitmap) |
| 452 { | 452 { |
| 453 } | 453 } |
| 454 | 454 |
| 455 } // namespace blink | 455 } // namespace blink |
| OLD | NEW |