OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |