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

Side by Side Diff: ui/gfx/image/image_skia.cc

Issue 372883002: Use 2x resources for 1.25 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated test Created 6 years, 5 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
« no previous file with comments | « no previous file | ui/gfx/image/image_skia_unittest.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) 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 "ui/gfx/image/image_skia.h" 5 #include "ui/gfx/image/image_skia.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 // static 26 // static
27 gfx::ImageSkiaRep& NullImageRep() { 27 gfx::ImageSkiaRep& NullImageRep() {
28 CR_DEFINE_STATIC_LOCAL(ImageSkiaRep, null_image_rep, ()); 28 CR_DEFINE_STATIC_LOCAL(ImageSkiaRep, null_image_rep, ());
29 return null_image_rep; 29 return null_image_rep;
30 } 30 }
31 31
32 std::vector<float>* g_supported_scales = NULL; 32 std::vector<float>* g_supported_scales = NULL;
33 33
34 // The difference to fall back to the smaller scale factor rather than the 34 // The difference to fall back to the smaller scale factor rather than the
35 // larger one. For example, assume 1.25 is requested but only 1.0 and 2.0 are 35 // larger one. For example, assume 1.20 is requested but only 1.0 and 2.0 are
36 // supported. In that case, not fall back to 2.0 but 1.0, and then expand 36 // supported. In that case, not fall back to 2.0 but 1.0, and then expand
37 // the image to 1.25. 37 // the image to 1.25.
38 const float kFallbackToSmallerScaleDiff = 0.25f; 38 const float kFallbackToSmallerScaleDiff = 0.20f;
39 39
40 } // namespace 40 } // namespace
41 41
42 namespace internal { 42 namespace internal {
43 namespace { 43 namespace {
44 44
45 class Matcher { 45 class Matcher {
46 public: 46 public:
47 explicit Matcher(float scale) : scale_(scale) { 47 explicit Matcher(float scale) : scale_(scale) {
48 } 48 }
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 bool ImageSkia::CanModify() const { 498 bool ImageSkia::CanModify() const {
499 return !storage_.get() || storage_->CanModify(); 499 return !storage_.get() || storage_->CanModify();
500 } 500 }
501 501
502 void ImageSkia::DetachStorageFromThread() { 502 void ImageSkia::DetachStorageFromThread() {
503 if (storage_.get()) 503 if (storage_.get())
504 storage_->DetachFromThread(); 504 storage_->DetachFromThread();
505 } 505 }
506 506
507 } // namespace gfx 507 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/image/image_skia_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698