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

Unified Diff: content/browser/renderer_host/backing_store_mac.mm

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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/backing_store_mac.mm
diff --git a/content/browser/renderer_host/backing_store_mac.mm b/content/browser/renderer_host/backing_store_mac.mm
index 0cb5a3b6c2f7d2976b0b3e36812cf17a374466c3..e154d014c321cd442d9640368fffa630c5eeab6f 100644
--- a/content/browser/renderer_host/backing_store_mac.mm
+++ b/content/browser/renderer_host/backing_store_mac.mm
@@ -18,22 +18,11 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/size_conversions.h"
#include "ui/gfx/scoped_cg_context_save_gstate_mac.h"
#include "ui/surface/transport_dib.h"
-namespace {
-
-// Returns a Rect obtained by flooring the values of the given RectF.
-gfx::Rect ToFlooredRect(const gfx::RectF& rect) {
- return gfx::Rect(static_cast<int>(std::floor(rect.x())),
- static_cast<int>(std::floor(rect.y())),
- static_cast<int>(std::floor(rect.width())),
- static_cast<int>(std::floor(rect.height())));
-}
-
-} // namespace
-
namespace content {
// Mac Backing Stores:
@@ -102,7 +91,7 @@ void BackingStoreMac::PaintToBackingStore(
gfx::Size pixel_size = gfx::ToFlooredSize(
size().Scale(device_scale_factor_));
gfx::Rect pixel_bitmap_rect =
- ToFlooredRect(bitmap_rect.Scale(scale_factor));
+ ToFlooredRectDeprecated(bitmap_rect.Scale(scale_factor));
size_t bitmap_byte_count =
pixel_bitmap_rect.width() * pixel_bitmap_rect.height() * 4;
@@ -122,7 +111,7 @@ void BackingStoreMac::PaintToBackingStore(
for (size_t i = 0; i < copy_rects.size(); i++) {
const gfx::Rect& copy_rect = copy_rects[i];
gfx::Rect pixel_copy_rect =
- ToFlooredRect(copy_rect.Scale(scale_factor));
+ ToFlooredRectDeprecated(copy_rect.Scale(scale_factor));
// Only the subpixels given by copy_rect have pixels to copy.
base::mac::ScopedCFTypeRef<CGImageRef> image(
« no previous file with comments | « no previous file | content/renderer/browser_plugin/browser_plugin_backing_store.cc » ('j') | ui/gfx/rect_conversions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698