OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "platform/graphics/StaticBitmapImage.h" | 6 #include "platform/graphics/StaticBitmapImage.h" |
7 | 7 |
8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
9 #include "platform/graphics/ImageObserver.h" | 9 #include "platform/graphics/ImageObserver.h" |
10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 ASSERT(m_image); | 26 ASSERT(m_image); |
27 } | 27 } |
28 | 28 |
29 StaticBitmapImage::~StaticBitmapImage() { } | 29 StaticBitmapImage::~StaticBitmapImage() { } |
30 | 30 |
31 IntSize StaticBitmapImage::size() const | 31 IntSize StaticBitmapImage::size() const |
32 { | 32 { |
33 return IntSize(m_image->width(), m_image->height()); | 33 return IntSize(m_image->width(), m_image->height()); |
34 } | 34 } |
35 | 35 |
36 bool StaticBitmapImage::currentFrameKnownToBeOpaque() | 36 bool StaticBitmapImage::currentFrameKnownToBeOpaque(MetadataMode) |
37 { | 37 { |
38 return m_image->isOpaque(); | 38 return m_image->isOpaque(); |
39 } | 39 } |
40 | 40 |
41 void StaticBitmapImage::draw(SkCanvas* canvas, const SkPaint& paint, const Float
Rect& dstRect, | 41 void StaticBitmapImage::draw(SkCanvas* canvas, const SkPaint& paint, const Float
Rect& dstRect, |
42 const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode cla
mpMode) | 42 const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode cla
mpMode) |
43 { | 43 { |
44 ASSERT(dstRect.width() >= 0 && dstRect.height() >= 0); | 44 ASSERT(dstRect.width() >= 0 && dstRect.height() >= 0); |
45 ASSERT(srcRect.width() >= 0 && srcRect.height() >= 0); | 45 ASSERT(srcRect.width() >= 0 && srcRect.height() >= 0); |
46 | 46 |
(...skipping 12 matching lines...) Expand all Loading... |
59 if (ImageObserver* observer = imageObserver()) | 59 if (ImageObserver* observer = imageObserver()) |
60 observer->didDraw(this); | 60 observer->didDraw(this); |
61 } | 61 } |
62 | 62 |
63 PassRefPtr<SkImage> StaticBitmapImage::imageForCurrentFrame() | 63 PassRefPtr<SkImage> StaticBitmapImage::imageForCurrentFrame() |
64 { | 64 { |
65 return m_image; | 65 return m_image; |
66 } | 66 } |
67 | 67 |
68 } // namespace blink | 68 } // namespace blink |
OLD | NEW |