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

Unified Diff: Source/core/layout/shapes/Shape.cpp

Issue 1170523002: Removing GraphicsContext from ImageBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix unit test crashes Created 5 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
Index: Source/core/layout/shapes/Shape.cpp
diff --git a/Source/core/layout/shapes/Shape.cpp b/Source/core/layout/shapes/Shape.cpp
index ccb6c5fceda8b33c6d1bfc759d54c0fe8d0d52c6..872276df05733ed6bc08501489b19a8f18a54d00 100644
--- a/Source/core/layout/shapes/Shape.cpp
+++ b/Source/core/layout/shapes/Shape.cpp
@@ -43,7 +43,6 @@
#include "platform/LengthFunctions.h"
#include "platform/geometry/FloatRoundedRect.h"
#include "platform/geometry/FloatSize.h"
-#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/GraphicsTypes.h"
#include "platform/graphics/ImageBuffer.h"
#include "wtf/ArrayBufferContents.h"
@@ -199,12 +198,12 @@ PassOwnPtr<Shape> Shape::createRasterShape(Image* image, float threshold, const
OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.size());
if (image && imageBuffer) {
- GraphicsContext* graphicsContext = imageBuffer->context();
// FIXME: This is not totally correct but it is needed to prevent shapes
// that loads SVG Images during paint invalidations to mark layoutObjects for
// layout, which is not allowed. See https://crbug.com/429346
ImageObserverDisabler disabler(image);
- graphicsContext->drawImage(image, IntRect(IntPoint(), imageRect.size()));
+ SkPaint paint;
+ image->draw(imageBuffer->canvas(), paint, imageRect, imageRect, DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect);
WTF::ArrayBufferContents contents;
imageBuffer->getImageData(Unmultiplied, IntRect(IntPoint(), imageRect.size()), contents);

Powered by Google App Engine
This is Rietveld 408576698