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

Unified Diff: third_party/WebKit/WebCore/platform/graphics/qt/ImageQt.cpp

Issue 21184: WebKit merge 40722:40785 (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/WebCore/platform/graphics/qt/ImageQt.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/qt/ImageQt.cpp (revision 9391)
+++ third_party/WebKit/WebCore/platform/graphics/qt/ImageQt.cpp (working copy)
@@ -96,7 +96,24 @@
void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const TransformationMatrix& patternTransform,
const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect)
{
- notImplemented();
+ QPixmap* framePixmap = nativeImageForCurrentFrame();
+ if (!framePixmap) // If it's too early we won't have an image yet.
+ return;
+
+ QPixmap pixmap = *framePixmap;
+ QRect tr = QRectF(tileRect).toRect();
+ if (tr.x() || tr.y() || tr.width() != pixmap.width() || tr.height() != pixmap.height()) {
+ pixmap = pixmap.copy(tr);
+ }
+
+ QBrush b(pixmap);
+ b.setMatrix(patternTransform);
+ ctxt->save();
+ ctxt->setCompositeOperation(op);
+ QPainter* p = ctxt->platformContext();
+ p->setBrushOrigin(phase);
+ p->fillRect(destRect, b);
+ ctxt->restore();
}
void BitmapImage::initPlatformData()
@@ -138,29 +155,6 @@
ctxt->restore();
}
-void BitmapImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const TransformationMatrix& patternTransform,
- const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect)
-{
- QPixmap* framePixmap = nativeImageForCurrentFrame();
- if (!framePixmap) // If it's too early we won't have an image yet.
- return;
-
- QPixmap pixmap = *framePixmap;
- QRect tr = QRectF(tileRect).toRect();
- if (tr.x() || tr.y() || tr.width() != pixmap.width() || tr.height() != pixmap.height()) {
- pixmap = pixmap.copy(tr);
- }
-
- QBrush b(pixmap);
- b.setMatrix(patternTransform);
- ctxt->save();
- ctxt->setCompositeOperation(op);
- QPainter* p = ctxt->platformContext();
- p->setBrushOrigin(phase);
- p->fillRect(destRect, b);
- ctxt->restore();
-}
-
void BitmapImage::checkForSolidColor()
{
// FIXME: It's easy to implement this optimization. Just need to check the RGBA32 buffer to see if it is 1x1.

Powered by Google App Engine
This is Rietveld 408576698