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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use IntSize for SVGImageForContainer Created 5 years, 1 month 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Don't let images that have a width/height >= 1 shrink below 1 when zo omed. 60 // Don't let images that have a width/height >= 1 shrink below 1 when zo omed.
61 if (fixedSize.width() > 0) 61 if (fixedSize.width() > 0)
62 width = max<LayoutUnit>(1, width); 62 width = max<LayoutUnit>(1, width);
63 63
64 if (fixedSize.height() > 0) 64 if (fixedSize.height() > 0)
65 height = max<LayoutUnit>(1, height); 65 height = max<LayoutUnit>(1, height);
66 66
67 return LayoutSize(width, height); 67 return LayoutSize(width, height);
68 } 68 }
69 69
70 return LayoutSize(m_containerSize); 70 return LayoutSize();
71 } 71 }
72 72
73 void StyleGeneratedImage::computeIntrinsicDimensions(const LayoutObject* layoutO bject, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRati o) 73 void StyleGeneratedImage::computeIntrinsicDimensions(const LayoutObject* layoutO bject, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRati o)
74 { 74 {
75 // At a zoom level of 1 the image is guaranteed to have an integer size. 75 // At a zoom level of 1 the image is guaranteed to have an integer size.
76 IntSize size = flooredIntSize(imageSize(layoutObject, 1)); 76 IntSize size = flooredIntSize(imageSize(layoutObject, 1));
77 intrinsicWidth = Length(size.width(), Fixed); 77 intrinsicWidth = Length(size.width(), Fixed);
78 intrinsicHeight = Length(size.height(), Fixed); 78 intrinsicHeight = Length(size.height(), Fixed);
79 intrinsicRatio = FloatSize(size); 79 intrinsicRatio = FloatSize(size);
80 } 80 }
81 81
82 void StyleGeneratedImage::addClient(LayoutObject* layoutObject) 82 void StyleGeneratedImage::addClient(LayoutObject* layoutObject)
83 { 83 {
84 m_imageGeneratorValue->addClient(layoutObject, IntSize()); 84 m_imageGeneratorValue->addClient(layoutObject, IntSize());
85 } 85 }
86 86
87 void StyleGeneratedImage::removeClient(LayoutObject* layoutObject) 87 void StyleGeneratedImage::removeClient(LayoutObject* layoutObject)
88 { 88 {
89 m_imageGeneratorValue->removeClient(layoutObject); 89 m_imageGeneratorValue->removeClient(layoutObject);
90 } 90 }
91 91
92 PassRefPtr<Image> StyleGeneratedImage::image(const LayoutObject* layoutObject, c onst IntSize& size) const 92 PassRefPtr<Image> StyleGeneratedImage::image(const LayoutObject* layoutObject, c onst IntSize& size, float) const
93 { 93 {
94 return m_imageGeneratorValue->image(layoutObject, size); 94 return m_imageGeneratorValue->image(layoutObject, size);
95 } 95 }
96 96
97 bool StyleGeneratedImage::knownToBeOpaque(const LayoutObject* layoutObject) cons t 97 bool StyleGeneratedImage::knownToBeOpaque(const LayoutObject* layoutObject) cons t
98 { 98 {
99 return m_imageGeneratorValue->knownToBeOpaque(layoutObject); 99 return m_imageGeneratorValue->knownToBeOpaque(layoutObject);
100 } 100 }
101 101
102 DEFINE_TRACE(StyleGeneratedImage) 102 DEFINE_TRACE(StyleGeneratedImage)
103 { 103 {
104 visitor->trace(m_imageGeneratorValue); 104 visitor->trace(m_imageGeneratorValue);
105 StyleImage::trace(visitor); 105 StyleImage::trace(visitor);
106 } 106 }
107 107
108 } 108 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleGeneratedImage.h ('k') | third_party/WebKit/Source/core/style/StyleImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698