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

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

Issue 10824296: Enables HiDPI favicon to be displayed in tab strip on CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 4 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 | « ui/gfx/image/image_skia.h ('k') | 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 ImageSkia& ImageSkia::operator=(const SkBitmap& other) { 163 ImageSkia& ImageSkia::operator=(const SkBitmap& other) {
164 Init(ImageSkiaRep(other, ui::SCALE_FACTOR_100P)); 164 Init(ImageSkiaRep(other, ui::SCALE_FACTOR_100P));
165 return *this; 165 return *this;
166 } 166 }
167 167
168 ImageSkia::~ImageSkia() { 168 ImageSkia::~ImageSkia() {
169 } 169 }
170 170
171 bool ImageSkia::BackedBySameObjectAs(const gfx::ImageSkia& other) const {
172 return storage_.get() == other.storage_.get();
173 }
174
171 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) { 175 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) {
172 DCHECK(!image_rep.is_null()); 176 DCHECK(!image_rep.is_null());
173 177
174 if (isNull()) 178 if (isNull())
175 Init(image_rep); 179 Init(image_rep);
176 else 180 else
177 storage_->image_reps().push_back(image_rep); 181 storage_->image_reps().push_back(image_rep);
178 } 182 }
179 183
180 void ImageSkia::RemoveRepresentation(ui::ScaleFactor scale_factor) { 184 void ImageSkia::RemoveRepresentation(ui::ScaleFactor scale_factor) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 if (image_rep.sk_bitmap().empty()) { 295 if (image_rep.sk_bitmap().empty()) {
292 storage_ = NULL; 296 storage_ = NULL;
293 return; 297 return;
294 } 298 }
295 storage_ = new internal::ImageSkiaStorage( 299 storage_ = new internal::ImageSkiaStorage(
296 NULL, gfx::Size(image_rep.GetWidth(), image_rep.GetHeight())); 300 NULL, gfx::Size(image_rep.GetWidth(), image_rep.GetHeight()));
297 storage_->image_reps().push_back(image_rep); 301 storage_->image_reps().push_back(image_rep);
298 } 302 }
299 303
300 } // namespace gfx 304 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image_skia.h ('k') | ui/gfx/image/image_skia_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698