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

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

Issue 12213093: Remove ImageLoadingTracker class (Closed) Base URL: https://git.chromium.org/chromium/src.git@Issue_163929
Patch Set: Fix merge conflict Created 7 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
« no previous file with comments | « chrome/common/extensions/extension_unittest.cc ('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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return storage_.get() == other.storage_.get(); 249 return storage_.get() == other.storage_.get();
250 } 250 }
251 251
252 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) { 252 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) {
253 DCHECK(!image_rep.is_null()); 253 DCHECK(!image_rep.is_null());
254 254
255 // TODO(oshima): This method should be called |SetRepresentation| 255 // TODO(oshima): This method should be called |SetRepresentation|
256 // and replace the existing rep if there is already one with the 256 // and replace the existing rep if there is already one with the
257 // same scale factor so that we can guarantee that a ImageSkia 257 // same scale factor so that we can guarantee that a ImageSkia
258 // instance contians only one image rep per scale factor. This is 258 // instance contians only one image rep per scale factor. This is
259 // not possible now as ImageLoadingTracker currently stores need 259 // not possible now as ImageLoader currently stores need
260 // this feature, but this needs to be fixed. 260 // this feature, but this needs to be fixed.
261 if (isNull()) { 261 if (isNull()) {
262 Init(image_rep); 262 Init(image_rep);
263 } else { 263 } else {
264 CHECK(CanModify()); 264 CHECK(CanModify());
265 storage_->image_reps().push_back(image_rep); 265 storage_->image_reps().push_back(image_rep);
266 } 266 }
267 } 267 }
268 268
269 void ImageSkia::RemoveRepresentation(ui::ScaleFactor scale_factor) { 269 void ImageSkia::RemoveRepresentation(ui::ScaleFactor scale_factor) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 bool ImageSkia::CanModify() const { 404 bool ImageSkia::CanModify() const {
405 return !storage_ || storage_->CanModify(); 405 return !storage_ || storage_->CanModify();
406 } 406 }
407 407
408 void ImageSkia::DetachStorageFromThread() { 408 void ImageSkia::DetachStorageFromThread() {
409 if (storage_) 409 if (storage_)
410 storage_->DetachFromThread(); 410 storage_->DetachFromThread();
411 } 411 }
412 412
413 } // namespace gfx 413 } // namespace gfx
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_unittest.cc ('k') | ui/gfx/image/image_skia_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698