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

Unified Diff: Source/platform/graphics/skia/OpaqueRegionSkia.cpp

Issue 417153002: Avoid passing uninitialized value to markRectAsNonOpaque. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments addressed. Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/skia/OpaqueRegionSkia.cpp
diff --git a/Source/platform/graphics/skia/OpaqueRegionSkia.cpp b/Source/platform/graphics/skia/OpaqueRegionSkia.cpp
index 24c0369d2ee641c597367d4f4541d6d0d6364fa1..5ccacbe40bd4745b6b423016c17831467aea09fe 100644
--- a/Source/platform/graphics/skia/OpaqueRegionSkia.cpp
+++ b/Source/platform/graphics/skia/OpaqueRegionSkia.cpp
@@ -156,8 +156,10 @@ static inline bool paintIsOpaque(const SkPaint& paint, OpaqueRegionSkia::DrawTyp
static inline bool getDeviceClipAsRect(const GraphicsContext* context, SkRect& deviceClipRect)
{
// Get the current clip in device coordinate space.
- if (!context->canvas()->isClipRect())
+ if (!context->canvas()->isClipRect()) {
+ deviceClipRect.setEmpty();
return false;
+ }
SkIRect deviceClipIRect;
if (context->canvas()->getClipDeviceBounds(&deviceClipIRect))
@@ -331,7 +333,7 @@ void OpaqueRegionSkia::applyOpaqueRegionFromLayer(const GraphicsContext* context
SkRect deviceClipRect;
bool deviceClipIsARect = getDeviceClipAsRect(context, deviceClipRect);
- if (deviceClipRect.isEmpty())
+ if (deviceClipRect.isEmpty() && deviceClipIsARect)
danakj 2014/07/28 14:03:57 reverse this order
sohanjg 2014/07/30 10:23:46 Done.
return;
SkRect sourceOpaqueRect = layerOpaqueRect;
@@ -339,11 +341,9 @@ void OpaqueRegionSkia::applyOpaqueRegionFromLayer(const GraphicsContext* context
SkRect destinationOpaqueRect = currentTrackingOpaqueRect();
bool outsideSourceOpaqueRectPreservesOpaque = xfermodePreservesOpaque(paint, false);
- if (!outsideSourceOpaqueRectPreservesOpaque)
- markRectAsNonOpaque(deviceClipRect);
+ if (!outsideSourceOpaqueRectPreservesOpaque && !deviceClipIsARect)
+ markAllAsNonOpaque();
danakj 2014/07/28 14:03:56 if it is a rect, you need to still do what we did
sohanjg 2014/07/30 10:23:46 Done.
- if (!deviceClipIsARect)
- return;
if (!sourceOpaqueRect.intersect(deviceClipRect))
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698