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

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

Issue 2665623002: Fix Jumplist favicons to have high resolution in HDPI Windows displays (Closed)
Patch Set: Update comments and remove redundant .h files. Created 3 years, 10 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
« ui/gfx/image/image_skia.h ('K') | « ui/gfx/image/image_skia.h ('k') | no next file » | 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 #if !defined(OS_WIN) 504 #if !defined(OS_WIN)
505 CHECK(CanRead()); 505 CHECK(CanRead());
506 #endif 506 #endif
507 507
508 ImageSkiaReps::iterator it = storage_->FindRepresentation(1.0f, true); 508 ImageSkiaReps::iterator it = storage_->FindRepresentation(1.0f, true);
509 if (it != storage_->image_reps().end()) 509 if (it != storage_->image_reps().end())
510 return it->sk_bitmap(); 510 return it->sk_bitmap();
511 return NullImageRep().sk_bitmap(); 511 return NullImageRep().sk_bitmap();
512 } 512 }
513 513
514 // TODOs in ImageSkia() also apply to GetBitmap2x().
515 const SkBitmap& ImageSkia::GetBitmap2x() const {
516 if (isNull()) {
517 return NullImageRep().sk_bitmap();
518 }
519
520 #if !defined(OS_WIN)
521 CHECK(CanRead());
522 #endif
523
524 ImageSkiaReps::iterator it = storage_->FindRepresentation(2.0f, true);
525 if (it != storage_->image_reps().end())
526 return it->sk_bitmap();
527 return NullImageRep().sk_bitmap();
528 }
529
514 bool ImageSkia::CanRead() const { 530 bool ImageSkia::CanRead() const {
515 return !storage_.get() || storage_->CanRead(); 531 return !storage_.get() || storage_->CanRead();
516 } 532 }
517 533
518 bool ImageSkia::CanModify() const { 534 bool ImageSkia::CanModify() const {
519 return !storage_.get() || storage_->CanModify(); 535 return !storage_.get() || storage_->CanModify();
520 } 536 }
521 537
522 void ImageSkia::DetachStorageFromThread() { 538 void ImageSkia::DetachStorageFromThread() {
523 if (storage_.get()) 539 if (storage_.get())
524 storage_->DetachFromThread(); 540 storage_->DetachFromThread();
525 } 541 }
526 542
527 } // namespace gfx 543 } // namespace gfx
OLDNEW
« ui/gfx/image/image_skia.h ('K') | « ui/gfx/image/image_skia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698