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

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

Issue 11146009: Mac Flash: Fix scaling bitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up 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
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | webkit/plugins/ppapi/ppapi_unittest.h » ('j') | 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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 1040
1041 gfx::Point plugin_origin = PP_ToGfxPoint(view_data_.rect.point); 1041 gfx::Point plugin_origin = PP_ToGfxPoint(view_data_.rect.point);
1042 // Convert |paint_bounds| to be relative to the left-top corner of the plugin. 1042 // Convert |paint_bounds| to be relative to the left-top corner of the plugin.
1043 gfx::Rect relative_paint_bounds(paint_bounds); 1043 gfx::Rect relative_paint_bounds(paint_bounds);
1044 relative_paint_bounds.Offset(-plugin_origin.x(), -plugin_origin.y()); 1044 relative_paint_bounds.Offset(-plugin_origin.x(), -plugin_origin.y());
1045 1045
1046 gfx::Rect pixel_plugin_backing_store_rect( 1046 gfx::Rect pixel_plugin_backing_store_rect(
1047 0, 0, image_data->width(), image_data->height()); 1047 0, 0, image_data->width(), image_data->height());
1048 float scale = GetBoundGraphics2D()->GetScale(); 1048 float scale = GetBoundGraphics2D()->GetScale();
1049 gfx::Rect plugin_backing_store_rect = 1049 gfx::Rect plugin_backing_store_rect =
1050 gfx::ToEnclosingRect(pixel_plugin_backing_store_rect.Scale(scale)); 1050 gfx::ToEnclosedRect(pixel_plugin_backing_store_rect.Scale(scale));
1051 1051
1052 gfx::Rect clip_page = PP_ToGfxRect(view_data_.clip_rect); 1052 gfx::Rect clip_page = PP_ToGfxRect(view_data_.clip_rect);
1053 gfx::Rect plugin_paint_rect = plugin_backing_store_rect.Intersect(clip_page); 1053 gfx::Rect plugin_paint_rect = plugin_backing_store_rect.Intersect(clip_page);
1054 if (!plugin_paint_rect.Contains(relative_paint_bounds)) 1054 if (!plugin_paint_rect.Contains(relative_paint_bounds))
1055 return false; 1055 return false;
1056 1056
1057 // Don't do optimized painting if the area to paint intersects with the 1057 // Don't do optimized painting if the area to paint intersects with the
1058 // cut-out rects, otherwise we will paint over them. 1058 // cut-out rects, otherwise we will paint over them.
1059 for (std::vector<gfx::Rect>::const_iterator iter = cut_outs_rects_.begin(); 1059 for (std::vector<gfx::Rect>::const_iterator iter = cut_outs_rects_.begin();
1060 iter != cut_outs_rects_.end(); ++iter) { 1060 iter != cut_outs_rects_.end(); ++iter) {
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 screen_size_for_fullscreen_ = gfx::Size(); 2831 screen_size_for_fullscreen_ = gfx::Size();
2832 WebElement element = container_->element(); 2832 WebElement element = container_->element();
2833 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2833 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2834 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2834 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2835 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2835 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2836 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2836 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2837 } 2837 }
2838 2838
2839 } // namespace ppapi 2839 } // namespace ppapi
2840 } // namespace webkit 2840 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | webkit/plugins/ppapi/ppapi_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698