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

Side by Side Diff: chrome/browser/thumbnails/simple_thumbnail_crop.cc

Issue 16336027: Enable high dpi in win/views. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/dragged_tab_view.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/thumbnails/simple_thumbnail_crop.h" 5 #include "chrome/browser/thumbnails/simple_thumbnail_crop.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "skia/ext/platform_canvas.h" 9 #include "skia/ext/platform_canvas.h"
10 #include "ui/gfx/color_utils.h" 10 #include "ui/gfx/color_utils.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 copy_size = gfx::ToFlooredSize(gfx::ScaleSize( 123 copy_size = gfx::ToFlooredSize(gfx::ScaleSize(
124 copy_size, ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P))); 124 copy_size, ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P)));
125 break; 125 break;
126 case ui::SCALE_FACTOR_200P: 126 case ui::SCALE_FACTOR_200P:
127 // Use the size as-is. 127 // Use the size as-is.
128 break; 128 break;
129 default: 129 default:
130 DLOG(WARNING) << "Unsupported scale factor. Use the same copy size as " 130 DLOG(WARNING) << "Unsupported scale factor. Use the same copy size as "
131 << "ui::SCALE_FACTOR_100P"; 131 << "ui::SCALE_FACTOR_100P";
132 copy_size = gfx::ToFlooredSize(gfx::ScaleSize( 132 copy_size = gfx::ToFlooredSize(gfx::ScaleSize(
133 copy_size, ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P))); 133 copy_size, ui::GetMaxScaleFactor()));
134 break; 134 break;
135 } 135 }
136 return copy_size; 136 return copy_size;
137 } 137 }
138 138
139 gfx::Rect SimpleThumbnailCrop::GetClippingRect(const gfx::Size& source_size, 139 gfx::Rect SimpleThumbnailCrop::GetClippingRect(const gfx::Size& source_size,
140 const gfx::Size& desired_size, 140 const gfx::Size& desired_size,
141 ClipResult* clip_result) { 141 ClipResult* clip_result) {
142 DCHECK(clip_result); 142 DCHECK(clip_result);
143 143
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 if (clipped_bitmap.width() == result.width() && 237 if (clipped_bitmap.width() == result.width() &&
238 clipped_bitmap.height() == result.height()) 238 clipped_bitmap.height() == result.height())
239 clipped_bitmap.copyTo(&result, SkBitmap::kARGB_8888_Config); 239 clipped_bitmap.copyTo(&result, SkBitmap::kARGB_8888_Config);
240 #endif 240 #endif
241 241
242 HISTOGRAM_TIMES(kThumbnailHistogramName, 242 HISTOGRAM_TIMES(kThumbnailHistogramName,
243 base::TimeTicks::Now() - begin_compute_thumbnail); 243 base::TimeTicks::Now() - begin_compute_thumbnail);
244 return result; 244 return result;
245 } 245 }
246 246
247 } 247 } // namespace thumbnails
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698