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

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: rebased 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
« no previous file with comments | « webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cd78ea8db33873f5b3880ad0c07ca198c5f09fc2..592b182ae9b64427c879ca5f0d85f22914f16023 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1174,14 +1174,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::ScaleRect(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::IntersectRects(plugin_backing_store_rect, clip_page);
if (!plugin_paint_rect.Contains(relative_paint_bounds))
return false;
« no previous file with comments | « webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698