| 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 #ifndef PlaceholderImage_h | 5 #ifndef PlaceholderImage_h |
| 6 #define PlaceholderImage_h | 6 #define PlaceholderImage_h |
| 7 | 7 |
| 8 #include "platform/SharedBuffer.h" | 8 #include "platform/SharedBuffer.h" |
| 9 #include "platform/geometry/IntSize.h" | 9 #include "platform/geometry/IntSize.h" |
| 10 #include "platform/graphics/Image.h" | 10 #include "platform/graphics/Image.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 sk_sp<SkImage> imageForCurrentFrame() override; | 39 sk_sp<SkImage> imageForCurrentFrame() override; |
| 40 | 40 |
| 41 void draw(SkCanvas*, | 41 void draw(SkCanvas*, |
| 42 const SkPaint&, | 42 const SkPaint&, |
| 43 const FloatRect& destRect, | 43 const FloatRect& destRect, |
| 44 const FloatRect& srcRect, | 44 const FloatRect& srcRect, |
| 45 RespectImageOrientationEnum, | 45 RespectImageOrientationEnum, |
| 46 ImageClampingMode) override; | 46 ImageClampingMode) override; |
| 47 | 47 |
| 48 void drawPattern(GraphicsContext&, | |
| 49 const FloatRect& srcRect, | |
| 50 const FloatSize& scale, | |
| 51 const FloatPoint& phase, | |
| 52 SkBlendMode, | |
| 53 const FloatRect& destRect, | |
| 54 const FloatSize& repeatSpacing) override; | |
| 55 | |
| 56 void destroyDecodedData() override; | 48 void destroyDecodedData() override; |
| 57 | 49 |
| 58 private: | 50 private: |
| 59 PlaceholderImage(ImageObserver* observer, const IntSize& size) | 51 PlaceholderImage(ImageObserver* observer, const IntSize& size) |
| 60 : Image(observer), m_size(size) {} | 52 : Image(observer), m_size(size) {} |
| 61 | 53 |
| 62 bool currentFrameHasSingleSecurityOrigin() const override { return true; } | 54 bool currentFrameHasSingleSecurityOrigin() const override { return true; } |
| 63 | 55 |
| 64 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { | 56 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { |
| 65 // Placeholder images are translucent. | 57 // Placeholder images are translucent. |
| 66 return false; | 58 return false; |
| 67 } | 59 } |
| 68 | 60 |
| 69 IntSize m_size; | 61 IntSize m_size; |
| 70 // Lazily initialized. | 62 // Lazily initialized. |
| 71 sk_sp<SkImage> m_imageForCurrentFrame; | 63 sk_sp<SkImage> m_imageForCurrentFrame; |
| 72 }; | 64 }; |
| 73 | 65 |
| 74 } // namespace blink | 66 } // namespace blink |
| 75 | 67 |
| 76 #endif | 68 #endif |
| OLD | NEW |