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

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: . 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
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 20 matching lines...) Expand all
31 } 31 }
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::Rect pixel_bitmap_rect = 40 gfx::Rect pixel_bitmap_rect =
41 gfx::ToEnclosingRect(bitmap_rect.Scale(scale_factor_)); 41 gfx::ToFlooredRectDeprecated(bitmap_rect.Scale(scale_factor_));
42 42
43 const int width = pixel_bitmap_rect.width(); 43 const int width = pixel_bitmap_rect.width();
44 const int height = pixel_bitmap_rect.height(); 44 const int height = pixel_bitmap_rect.height();
45 45
46 if (width <= 0 || width > kMaxSize || 46 if (width <= 0 || width > kMaxSize ||
47 height <= 0 || height > kMaxSize) 47 height <= 0 || height > kMaxSize)
48 return; 48 return;
49 49
50 if (!dib) 50 if (!dib)
51 return; 51 return;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 int x = std::min(pixel_rect.x(), pixel_rect.x() - pixel_dx); 86 int x = std::min(pixel_rect.x(), pixel_rect.x() - pixel_dx);
87 int y = std::min(pixel_rect.y(), pixel_rect.y() - pixel_dy); 87 int y = std::min(pixel_rect.y(), pixel_rect.y() - pixel_dy);
88 int w = pixel_rect.width() + abs(pixel_dx); 88 int w = pixel_rect.width() + abs(pixel_dx);
89 int h = pixel_rect.height() + abs(pixel_dy); 89 int h = pixel_rect.height() + abs(pixel_dy);
90 SkIRect rect = SkIRect::MakeXYWH(x, y, w, h); 90 SkIRect rect = SkIRect::MakeXYWH(x, y, w, h);
91 bitmap_.scrollRect(&rect, pixel_dx, pixel_dy); 91 bitmap_.scrollRect(&rect, pixel_dx, pixel_dy);
92 } 92 }
93 93
94 } // namespace content 94 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698