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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_backing_store.cc

Issue 11235017: Revert to old rect conversion behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 8 years, 1 month 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 | « content/browser/renderer_host/backing_store_mac.mm ('k') | content/renderer/render_widget.cc » ('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 "content/renderer/browser_plugin/browser_plugin_backing_store.h" 5 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h"
6 6
7 #include "ui/gfx/canvas.h" 7 #include "ui/gfx/canvas.h"
8 #include "ui/gfx/rect.h" 8 #include "ui/gfx/rect.h"
9 #include "ui/gfx/rect_conversions.h" 9 #include "ui/gfx/rect_conversions.h"
10 #include "ui/gfx/size_conversions.h" 10 #include "ui/gfx/size_conversions.h"
(...skipping 21 matching lines...) Expand all
32 32
33 void BrowserPluginBackingStore::PaintToBackingStore( 33 void BrowserPluginBackingStore::PaintToBackingStore(
34 const gfx::Rect& bitmap_rect, 34 const gfx::Rect& bitmap_rect,
35 const std::vector<gfx::Rect>& copy_rects, 35 const std::vector<gfx::Rect>& copy_rects,
36 TransportDIB* dib) { 36 TransportDIB* dib) {
37 if (bitmap_rect.IsEmpty()) 37 if (bitmap_rect.IsEmpty())
38 return; 38 return;
39 39
40 gfx::RectF scaled_bitmap_rect = bitmap_rect; 40 gfx::RectF scaled_bitmap_rect = bitmap_rect;
41 scaled_bitmap_rect.Scale(scale_factor_); 41 scaled_bitmap_rect.Scale(scale_factor_);
42 gfx::Rect pixel_bitmap_rect = gfx::ToEnclosingRect(scaled_bitmap_rect); 42 gfx::Rect pixel_bitmap_rect =
43 gfx::ToFlooredRectDeprecated(scaled_bitmap_rect);
43 44
44 const int width = pixel_bitmap_rect.width(); 45 const int width = pixel_bitmap_rect.width();
45 const int height = pixel_bitmap_rect.height(); 46 const int height = pixel_bitmap_rect.height();
46 47
47 if (width <= 0 || width > kMaxSize || 48 if (width <= 0 || width > kMaxSize ||
48 height <= 0 || height > kMaxSize) 49 height <= 0 || height > kMaxSize)
49 return; 50 return;
50 51
51 if (!dib) 52 if (!dib)
52 return; 53 return;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 90
90 int x = std::min(pixel_rect.x(), pixel_rect.x() - pixel_dx); 91 int x = std::min(pixel_rect.x(), pixel_rect.x() - pixel_dx);
91 int y = std::min(pixel_rect.y(), pixel_rect.y() - pixel_dy); 92 int y = std::min(pixel_rect.y(), pixel_rect.y() - pixel_dy);
92 int w = pixel_rect.width() + abs(pixel_dx); 93 int w = pixel_rect.width() + abs(pixel_dx);
93 int h = pixel_rect.height() + abs(pixel_dy); 94 int h = pixel_rect.height() + abs(pixel_dy);
94 SkIRect rect = SkIRect::MakeXYWH(x, y, w, h); 95 SkIRect rect = SkIRect::MakeXYWH(x, y, w, h);
95 bitmap_.scrollRect(&rect, pixel_dx, pixel_dy); 96 bitmap_.scrollRect(&rect, pixel_dx, pixel_dy);
96 } 97 }
97 98
98 } // namespace content 99 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/backing_store_mac.mm ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698