| Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| index 85c27d96a47feca1589f15814fa79c80aa08a782..923b88d4af73f2d488f800ba278162d082ba5df5 100644
|
| --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| @@ -376,7 +376,8 @@ int32_t PPB_Graphics2D_Impl::Flush(scoped_refptr<TrackedCallback> callback,
|
|
|
| // Set |no_update_visible| to false if the change overlaps the visible
|
| // area.
|
| - gfx::Rect visible_changed_rect = clip.Intersect(op_rect);
|
| + gfx::Rect visible_changed_rect = clip;
|
| + visible_changed_rect.Intersect(op_rect);
|
| if (!visible_changed_rect.IsEmpty())
|
| no_update_visible = false;
|
|
|
| @@ -560,7 +561,8 @@ void PPB_Graphics2D_Impl::Paint(WebKit::WebCanvas* canvas,
|
|
|
| CGContextDrawImage(canvas, bitmap_rect, image);
|
| #else
|
| - gfx::Rect invalidate_rect = plugin_rect.Intersect(paint_rect);
|
| + gfx::Rect invalidate_rect = plugin_rect;
|
| + invalidate_rect.Intersect(paint_rect);
|
| SkRect sk_invalidate_rect = gfx::RectToSkRect(invalidate_rect);
|
| SkAutoCanvasRestore auto_restore(canvas, true);
|
| canvas->clipRect(sk_invalidate_rect);
|
| @@ -647,12 +649,17 @@ bool PPB_Graphics2D_Impl::ConvertToLogicalPixels(float scale,
|
| // Take the enclosing rectangle after scaling so a rectangle scaled down then
|
| // scaled back up by the inverse scale would fully contain the entire area
|
| // affected by the original rectangle.
|
| - *op_rect = gfx::ToEnclosingRect(op_rect->Scale(scale));
|
| + gfx::RectF scaled_rect = *op_rect;
|
| + scaled_rect.Scale(scale);
|
| + *op_rect = gfx::ToEnclosingRect(scaled_rect);
|
| if (delta) {
|
| gfx::Point original_delta = *delta;
|
| float inverse_scale = 1.0f / scale;
|
| *delta = gfx::ToFlooredPoint(delta->Scale(scale));
|
| - if (original_rect != gfx::ToEnclosingRect(op_rect->Scale(inverse_scale)) ||
|
| +
|
| + gfx::RectF inverse_scaled_rect = *op_rect;
|
| + inverse_scaled_rect.Scale(inverse_scale);
|
| + if (original_rect != gfx::ToEnclosingRect(inverse_scaled_rect) ||
|
| original_delta != gfx::ToFlooredPoint(delta->Scale(inverse_scale))) {
|
| return false;
|
| }
|
|
|