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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 31bae32e8973844a067293d44aef7c5c8e298a15..4b1d1729caab7c16f34c2869f2d5a33c75bdffae 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1157,14 +1157,12 @@ bool PluginInstance::GetBitmapForOptimizedPluginPaint(
gfx::Rect pixel_plugin_backing_store_rect(
0, 0, image_data->width(), image_data->height());
float scale = GetBoundGraphics2D()->GetScale();
- gfx::RectF scaled_backing_store_rect = pixel_plugin_backing_store_rect;
- scaled_backing_store_rect.Scale(scale);
- gfx::Rect plugin_backing_store_rect =
- gfx::ToEnclosedRect(scaled_backing_store_rect);
+ gfx::Rect plugin_backing_store_rect = gfx::ToEnclosedRect(
+ gfx::Scale(pixel_plugin_backing_store_rect, scale));
gfx::Rect clip_page = PP_ToGfxRect(view_data_.clip_rect);
- gfx::Rect plugin_paint_rect = plugin_backing_store_rect;
- plugin_paint_rect.Intersect(clip_page);
+ gfx::Rect plugin_paint_rect =
+ gfx::Intersection(plugin_backing_store_rect, clip_page);
if (!plugin_paint_rect.Contains(relative_paint_bounds))
return false;

Powered by Google App Engine
This is Rietveld 408576698