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

Unified Diff: Source/core/platform/graphics/ImageForContainer.cpp

Issue 25627006: Generalize ImageForContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/ImageForContainer.cpp
diff --git a/Source/core/svg/graphics/SVGImageForContainer.cpp b/Source/core/platform/graphics/ImageForContainer.cpp
similarity index 80%
rename from Source/core/svg/graphics/SVGImageForContainer.cpp
rename to Source/core/platform/graphics/ImageForContainer.cpp
index 7b4e7c2980059c301c008d9bdb9d77060622f8ce..8c84a31e218f04ab84df4a02b912d5237ecfeaa3 100644
--- a/Source/core/svg/graphics/SVGImageForContainer.cpp
+++ b/Source/core/platform/graphics/ImageForContainer.cpp
@@ -18,7 +18,7 @@
*/
#include "config.h"
-#include "core/svg/graphics/SVGImageForContainer.h"
+#include "core/platform/graphics/ImageForContainer.h"
#include "core/platform/graphics/Image.h"
#include "core/svg/graphics/SVGImage.h"
@@ -28,26 +28,28 @@
namespace WebCore {
-IntSize SVGImageForContainer::size() const
+IntSize ImageForContainer::size() const
{
+ if (!isSVGImage())
+ return m_image->size();
pdr. 2013/10/04 21:08:04 Is this necessary? I thought we'd go through the l
Yoav Weiss 2013/10/08 08:47:24 m_containerSize and m_zoom are not defined for non
FloatSize scaledContainerSize(m_containerSize);
scaledContainerSize.scale(m_zoom);
return roundedIntSize(scaledContainerSize);
}
-void SVGImageForContainer::draw(GraphicsContext* context, const FloatRect& dstRect,
+void ImageForContainer::draw(GraphicsContext* context, const FloatRect& dstRect,
const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
{
m_image->drawForContainer(context, m_containerSize, m_zoom, dstRect, srcRect, compositeOp, blendMode);
}
-void SVGImageForContainer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale,
+void ImageForContainer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale,
const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
{
m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, scale, phase, compositeOp, dstRect, blendMode);
}
-PassRefPtr<NativeImageSkia> SVGImageForContainer::nativeImageForCurrentFrame()
+PassRefPtr<NativeImageSkia> ImageForContainer::nativeImageForCurrentFrame()
{
return m_image->nativeImageForCurrentFrame();
}

Powered by Google App Engine
This is Rietveld 408576698