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

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 for shape bug 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
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContextBase.cpp ('k') | Source/core/paint/ThemePainterMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fb58c8c86f8224f9df7504af82c6d36181c0795e 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,14 @@ 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;
+ IntRect imageSourceRect(IntPoint(), image->size());
+ IntRect imageDestRect(IntPoint(), imageRect.size());
+ image->draw(imageBuffer->canvas(), paint, imageDestRect, imageSourceRect, DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect);
WTF::ArrayBufferContents contents;
imageBuffer->getImageData(Unmultiplied, IntRect(IntPoint(), imageRect.size()), contents);
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContextBase.cpp ('k') | Source/core/paint/ThemePainterMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698