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

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

Issue 11377068: ui: Make gfx::Size::Scale() mutate the class. Add gfx::ScaleSize() similar to Rect/Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseTOGO 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 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 66095ca95924c168a49666145b170dcb4db784be..33bff148db532dd3d5b6210651a1eb53c7a24aa3 100644
--- a/content/browser/renderer_host/backing_store_mac.mm
+++ b/content/browser/renderer_host/backing_store_mac.mm
@@ -70,7 +70,8 @@ void BackingStoreMac::ScaleFactorChanged(float device_scale_factor) {
}
size_t BackingStoreMac::MemorySize() {
- return gfx::ToFlooredSize(size().Scale(device_scale_factor_)).GetArea() * 4;
+ return gfx::ToFlooredSize(
+ gfx::ScaleSize(size(), device_scale_factor_)).GetArea() * 4;
}
void BackingStoreMac::PaintToBackingStore(
@@ -89,7 +90,7 @@ void BackingStoreMac::PaintToBackingStore(
return;
gfx::Size pixel_size = gfx::ToFlooredSize(
- size().Scale(device_scale_factor_));
+ gfx::ScaleSize(size(), device_scale_factor_));
gfx::Rect pixel_bitmap_rect = ToFlooredRectDeprecated(
gfx::ScaleRect(bitmap_rect, scale_factor));
@@ -248,7 +249,7 @@ CGLayerRef BackingStoreMac::CreateCGLayer() {
DCHECK(cg_context);
// Note: This takes the backingScaleFactor of cg_context into account. The
- // bitmap backing |layer| with be size().Scale(2) in HiDPI mode automatically.
+ // bitmap backing |layer| will be size() * 2 in HiDPI mode automatically.
CGLayerRef layer = CGLayerCreateWithContext(cg_context,
size().ToCGSize(),
NULL);
@@ -258,7 +259,8 @@ CGLayerRef BackingStoreMac::CreateCGLayer() {
}
CGContextRef BackingStoreMac::CreateCGBitmapContext() {
- gfx::Size pixel_size = gfx::ToFlooredSize(size().Scale(device_scale_factor_));
+ gfx::Size pixel_size = gfx::ToFlooredSize(
+ gfx::ScaleSize(size(), device_scale_factor_));
// A CGBitmapContext serves as a stand-in for the layer before the view is
// in a containing window.
CGContextRef context = CGBitmapContextCreate(NULL,
« no previous file with comments | « content/browser/renderer_host/backing_store_aura.cc ('k') | content/browser/renderer_host/compositing_iosurface_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698