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

Unified Diff: Source/platform/graphics/CrossfadeGeneratedImage.cpp

Issue 323013004: Clean up transform methods in GraphicsContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2nd Attempt Mac build fix Created 6 years, 6 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
« no previous file with comments | « Source/platform/DragImage.cpp ('k') | Source/platform/graphics/GradientGeneratedImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/CrossfadeGeneratedImage.cpp
diff --git a/Source/platform/graphics/CrossfadeGeneratedImage.cpp b/Source/platform/graphics/CrossfadeGeneratedImage.cpp
index cea711af00750a4524d3e554d85d7b0fd9f71cfb..667e2553eccb0d74cebcd8306a3e526a1b00abd2 100644
--- a/Source/platform/graphics/CrossfadeGeneratedImage.cpp
+++ b/Source/platform/graphics/CrossfadeGeneratedImage.cpp
@@ -62,9 +62,9 @@ void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext* context)
// Draw the image we're fading away from.
context->save();
if (m_crossfadeSize != fromImageSize) {
- context->scale(FloatSize(
+ context->scale(
static_cast<float>(m_crossfadeSize.width()) / fromImageSize.width(),
- static_cast<float>(m_crossfadeSize.height()) / fromImageSize.height()));
+ static_cast<float>(m_crossfadeSize.height()) / fromImageSize.height());
}
context->setAlphaAsFloat(inversePercentage);
context->drawImage(m_fromImage, IntPoint());
@@ -73,9 +73,9 @@ void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext* context)
// Draw the image we're fading towards.
context->save();
if (m_crossfadeSize != toImageSize) {
- context->scale(FloatSize(
+ context->scale(
static_cast<float>(m_crossfadeSize.width()) / toImageSize.width(),
- static_cast<float>(m_crossfadeSize.height()) / toImageSize.height()));
+ static_cast<float>(m_crossfadeSize.height()) / toImageSize.height());
}
context->setAlphaAsFloat(m_percentage);
context->drawImage(m_toImage, IntPoint(), CompositePlusLighter);
@@ -91,7 +91,7 @@ void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& ds
context->clip(dstRect);
context->translate(dstRect.x(), dstRect.y());
if (dstRect.size() != srcRect.size())
- context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
+ context->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height());
context->translate(-srcRect.x(), -srcRect.y());
drawCrossfade(context);
« no previous file with comments | « Source/platform/DragImage.cpp ('k') | Source/platform/graphics/GradientGeneratedImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698