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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10996037: Do not convert from RectF to Rect by flooring. (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 unified diff | Download patch | Annotate | Revision Log
« ui/gfx/size_base.h ('K') | « ui/ui.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 1007
1008 gfx::Point plugin_origin = PP_ToGfxPoint(view_data_.rect.point); 1008 gfx::Point plugin_origin = PP_ToGfxPoint(view_data_.rect.point);
1009 // Convert |paint_bounds| to be relative to the left-top corner of the plugin. 1009 // Convert |paint_bounds| to be relative to the left-top corner of the plugin.
1010 gfx::Rect relative_paint_bounds(paint_bounds); 1010 gfx::Rect relative_paint_bounds(paint_bounds);
1011 relative_paint_bounds.Offset(-plugin_origin.x(), -plugin_origin.y()); 1011 relative_paint_bounds.Offset(-plugin_origin.x(), -plugin_origin.y());
1012 1012
1013 gfx::Rect pixel_plugin_backing_store_rect( 1013 gfx::Rect pixel_plugin_backing_store_rect(
1014 0, 0, image_data->width(), image_data->height()); 1014 0, 0, image_data->width(), image_data->height());
1015 float scale = GetBoundGraphics2D()->GetScale(); 1015 float scale = GetBoundGraphics2D()->GetScale();
1016 gfx::Rect plugin_backing_store_rect = 1016 gfx::Rect plugin_backing_store_rect =
1017 pixel_plugin_backing_store_rect.Scale(scale); 1017 pixel_plugin_backing_store_rect.ScaleUnsafe(scale);
1018 1018
1019 gfx::Rect clip_page = PP_ToGfxRect(view_data_.clip_rect); 1019 gfx::Rect clip_page = PP_ToGfxRect(view_data_.clip_rect);
1020 gfx::Rect plugin_paint_rect = plugin_backing_store_rect.Intersect(clip_page); 1020 gfx::Rect plugin_paint_rect = plugin_backing_store_rect.Intersect(clip_page);
1021 if (!plugin_paint_rect.Contains(relative_paint_bounds)) 1021 if (!plugin_paint_rect.Contains(relative_paint_bounds))
1022 return false; 1022 return false;
1023 1023
1024 // Don't do optimized painting if the area to paint intersects with the 1024 // Don't do optimized painting if the area to paint intersects with the
1025 // cut-out rects, otherwise we will paint over them. 1025 // cut-out rects, otherwise we will paint over them.
1026 for (std::vector<gfx::Rect>::const_iterator iter = cut_outs_rects_.begin(); 1026 for (std::vector<gfx::Rect>::const_iterator iter = cut_outs_rects_.begin();
1027 iter != cut_outs_rects_.end(); ++iter) { 1027 iter != cut_outs_rects_.end(); ++iter) {
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 screen_size_for_fullscreen_ = gfx::Size(); 2683 screen_size_for_fullscreen_ = gfx::Size();
2684 WebElement element = container_->element(); 2684 WebElement element = container_->element();
2685 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2685 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2686 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2686 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2687 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2687 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2688 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2688 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2689 } 2689 }
2690 2690
2691 } // namespace ppapi 2691 } // namespace ppapi
2692 } // namespace webkit 2692 } // namespace webkit
OLDNEW
« ui/gfx/size_base.h ('K') | « ui/ui.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698