Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.cpp

Issue 1694263003: Add Image::updateConcreteSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-size-calculation-in
Patch Set: Pull test for now, needs changes in upcoming CL to pass. Address nits. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698