| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/graphics/PlaceholderImage.h" | 5 #include "platform/graphics/PlaceholderImage.h" |
| 6 | 6 |
| 7 #include "platform/geometry/FloatRect.h" | 7 #include "platform/geometry/FloatRect.h" |
| 8 #include "platform/graphics/Color.h" | 8 #include "platform/graphics/Color.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/ImageObserver.h" | 10 #include "platform/graphics/ImageObserver.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()); | 47 SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()); |
| 48 | 48 |
| 49 return m_imageForCurrentFrame; | 49 return m_imageForCurrentFrame; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void PlaceholderImage::draw(PaintCanvas* canvas, | 52 void PlaceholderImage::draw(PaintCanvas* canvas, |
| 53 const PaintFlags& baseFlags, | 53 const PaintFlags& baseFlags, |
| 54 const FloatRect& destRect, | 54 const FloatRect& destRect, |
| 55 const FloatRect& srcRect, | 55 const FloatRect& srcRect, |
| 56 RespectImageOrientationEnum, | 56 RespectImageOrientationEnum, |
| 57 ImageClampingMode, | 57 ImageClampingMode) { |
| 58 const ColorBehavior& colorBehavior) { | |
| 59 // TODO(ccameron): This function should not ignore |colorBehavior|. | |
| 60 // https://crbug.com/672306 | |
| 61 if (!srcRect.intersects(FloatRect(0.0f, 0.0f, | 58 if (!srcRect.intersects(FloatRect(0.0f, 0.0f, |
| 62 static_cast<float>(m_size.width()), | 59 static_cast<float>(m_size.width()), |
| 63 static_cast<float>(m_size.height())))) { | 60 static_cast<float>(m_size.height())))) { |
| 64 return; | 61 return; |
| 65 } | 62 } |
| 66 | 63 |
| 67 PaintFlags flags(baseFlags); | 64 PaintFlags flags(baseFlags); |
| 68 flags.setStyle(PaintFlags::kFill_Style); | 65 flags.setStyle(PaintFlags::kFill_Style); |
| 69 flags.setColor(kFillColor); | 66 flags.setColor(kFillColor); |
| 70 canvas->drawRect(destRect, flags); | 67 canvas->drawRect(destRect, flags); |
| 71 } | 68 } |
| 72 | 69 |
| 73 void PlaceholderImage::destroyDecodedData() { | 70 void PlaceholderImage::destroyDecodedData() { |
| 74 m_imageForCurrentFrame.reset(); | 71 m_imageForCurrentFrame.reset(); |
| 75 } | 72 } |
| 76 | 73 |
| 77 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |