diff options
author | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-20 21:07:34 +0000 |
---|---|---|
committer | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-20 21:07:34 +0000 |
commit | f5fb0b881ef3a0aaacb05e4192e151c1383ff910 (patch) | |
tree | 53800b8f211a34e58c017a6d3eaf72c60ee61191 /chrome/common/thumbnail_score.h | |
parent | aaebafb1692dccdde86e5489059f6c6f09060e6f (diff) | |
download | chromium_src-f5fb0b881ef3a0aaacb05e4192e151c1383ff910.zip chromium_src-f5fb0b881ef3a0aaacb05e4192e151c1383ff910.tar.gz chromium_src-f5fb0b881ef3a0aaacb05e4192e151c1383ff910.tar.bz2 |
Allow wider than tall clipping as good clipping and add kTooWiderThanTall.
This CL changes ThumbnailGenerator to accept wider than tall pages as good clipping, and penalize its boring score instead.
On devices with a small display (and especially under Aura shell), most pages are wider than tall, so good clipping is rarely obtained and almost every tab switching causes to generate thumbnail without this change.
BUG=96351
TEST=Manually checked that wider than tall bitmap is accepted as good clipping in ThumbnailGenerator.
Review URL: http://codereview.chromium.org/9720039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/thumbnail_score.h')
-rw-r--r-- | chrome/common/thumbnail_score.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/common/thumbnail_score.h b/chrome/common/thumbnail_score.h index 3472028..56d7d42 100644 --- a/chrome/common/thumbnail_score.h +++ b/chrome/common/thumbnail_score.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -44,9 +44,10 @@ struct ThumbnailScore { // browser window size. double boring_score; - // Whether the thumbnail was taken with height greater then - // width. In cases where we don't have |good_clipping|, the - // thumbnails are either clipped from the horizontal center of the + // Whether the thumbnail was taken with height greater than + // width or width greater than height and the aspect ratio less than + // kTooWideAspectRatio. In cases where we don't have |good_clipping|, + // the thumbnails are either clipped from the horizontal center of the // window, or are otherwise weirdly stretched. bool good_clipping; @@ -95,6 +96,10 @@ struct ThumbnailScore { // Penalty of how much more boring a thumbnail should be per hour. static const double kThumbnailDegradePerHour; + // If a thumbnail is taken with the aspect ratio greater than or equal to + // this value, |good_clipping| is to false. + static const double kTooWideAspectRatio; + // Checks whether we should consider updating a new thumbnail based on // this score. For instance, we don't have to update a new thumbnail // if the current thumbnail is new and interesting enough. |