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

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

Issue 665673004: Move selection invalidation to the invalidation phase (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated after Xianzhu's comments. Created 6 years, 1 month 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/rendering/RenderView.cpp ('k') | Source/core/svg/graphics/SVGImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/Shape.cpp
diff --git a/Source/core/rendering/shapes/Shape.cpp b/Source/core/rendering/shapes/Shape.cpp
index bce2eb7ebb859d38226bade38685e537fc1c1d1e..e777bae9fe350be1cfb8459cd0b9be7393e80f3b 100644
--- a/Source/core/rendering/shapes/Shape.cpp
+++ b/Source/core/rendering/shapes/Shape.cpp
@@ -37,6 +37,7 @@
#include "core/rendering/shapes/RasterShape.h"
#include "core/rendering/shapes/RectangleShape.h"
#include "core/rendering/style/RenderStyle.h"
+#include "core/svg/graphics/SVGImage.h"
#include "platform/LengthFunctions.h"
#include "platform/geometry/FloatSize.h"
#include "platform/graphics/GraphicsContext.h"
@@ -192,8 +193,12 @@ PassOwnPtr<Shape> Shape::createRasterShape(Image* image, float threshold, const
OwnPtr<RasterShapeIntervals> intervals = adoptPtr(new RasterShapeIntervals(marginRect.height(), -marginRect.y()));
OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.size());
- if (imageBuffer) {
+ 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 renderers for
+ // layout, which is not allowed. See https://crbug.com/429346
+ ImageObserverDisabler disabler(image);
graphicsContext->drawImage(image, IntRect(IntPoint(), imageRect.size()));
RefPtr<Uint8ClampedArray> pixelArray = imageBuffer->getImageData(Unmultiplied, IntRect(IntPoint(), imageRect.size()));
« no previous file with comments | « Source/core/rendering/RenderView.cpp ('k') | Source/core/svg/graphics/SVGImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698