OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "third_party/skia/include/core/SkImage.h" | 25 #include "third_party/skia/include/core/SkImage.h" |
26 #include "wtf/PassRefPtr.h" | 26 #include "wtf/PassRefPtr.h" |
27 | 27 |
28 namespace blink { | 28 namespace blink { |
29 | 29 |
30 bool SVGImageForContainer::isTextureBacked() | 30 bool SVGImageForContainer::isTextureBacked() |
31 { | 31 { |
32 return m_image->isTextureBacked(); | 32 return m_image->isTextureBacked(); |
33 } | 33 } |
34 | 34 |
| 35 void SVGImageForContainer::updateConcreteObjectSize(const LayoutSize&) |
| 36 { |
| 37 // Wrapping should happen after sizing updates. |
| 38 ASSERT_NOT_REACHED(); |
| 39 } |
| 40 |
35 IntSize SVGImageForContainer::size() const | 41 IntSize SVGImageForContainer::size() const |
36 { | 42 { |
37 FloatSize scaledContainerSize(m_containerSize); | 43 FloatSize scaledContainerSize(m_containerSize); |
38 scaledContainerSize.scale(m_zoom); | 44 scaledContainerSize.scale(m_zoom); |
39 return roundedIntSize(scaledContainerSize); | 45 return roundedIntSize(scaledContainerSize); |
40 } | 46 } |
41 | 47 |
42 void SVGImageForContainer::draw(SkCanvas* canvas, const SkPaint& paint, const Fl
oatRect& dstRect, | 48 void SVGImageForContainer::draw(SkCanvas* canvas, const SkPaint& paint, const Fl
oatRect& dstRect, |
43 const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) | 49 const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) |
44 { | 50 { |
45 m_image->drawForContainer(canvas, paint, m_containerSize, m_zoom, dstRect, s
rcRect, m_url); | 51 m_image->drawForContainer(canvas, paint, m_containerSize, m_zoom, dstRect, s
rcRect, m_url); |
46 } | 52 } |
47 | 53 |
48 void SVGImageForContainer::drawPattern(GraphicsContext& context, const FloatRect
& srcRect, const FloatSize& scale, | 54 void SVGImageForContainer::drawPattern(GraphicsContext& context, const FloatRect
& srcRect, const FloatSize& scale, |
49 const FloatPoint& phase, SkXfermode::Mode op, const FloatRect& dstRect, cons
t FloatSize& repeatSpacing) | 55 const FloatPoint& phase, SkXfermode::Mode op, const FloatRect& dstRect, cons
t FloatSize& repeatSpacing) |
50 { | 56 { |
51 m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect,
scale, phase, op, dstRect, repeatSpacing, m_url); | 57 m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect,
scale, phase, op, dstRect, repeatSpacing, m_url); |
52 } | 58 } |
53 | 59 |
54 PassRefPtr<SkImage> SVGImageForContainer::imageForCurrentFrame() | 60 PassRefPtr<SkImage> SVGImageForContainer::imageForCurrentFrame() |
55 { | 61 { |
56 return m_image->imageForCurrentFrameForContainer(m_url); | 62 return m_image->imageForCurrentFrameForContainer(m_url); |
57 } | 63 } |
58 | 64 |
59 } // namespace blink | 65 } // namespace blink |
OLD | NEW |