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

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

Issue 2842693002: cros: Don't send duplicate UserSession mojo messages to ash (Closed)
Patch Set: Created 3 years, 8 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // thread so that other thread can use this. 351 // thread so that other thread can use this.
352 if (!copy->isNull()) 352 if (!copy->isNull())
353 copy->storage_->DetachFromThread(); 353 copy->storage_->DetachFromThread();
354 return base::WrapUnique(copy); 354 return base::WrapUnique(copy);
355 } 355 }
356 356
357 bool ImageSkia::BackedBySameObjectAs(const gfx::ImageSkia& other) const { 357 bool ImageSkia::BackedBySameObjectAs(const gfx::ImageSkia& other) const {
358 return storage_.get() == other.storage_.get(); 358 return storage_.get() == other.storage_.get();
359 } 359 }
360 360
361 bool ImageSkia::Equals(const gfx::ImageSkia& other) const {
362 return BackedBySameObjectAs(other);
363 }
364
361 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) { 365 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) {
362 DCHECK(!image_rep.is_null()); 366 DCHECK(!image_rep.is_null());
363 367
364 // TODO(oshima): This method should be called |SetRepresentation| 368 // TODO(oshima): This method should be called |SetRepresentation|
365 // and replace the existing rep if there is already one with the 369 // and replace the existing rep if there is already one with the
366 // same scale so that we can guarantee that a ImageSkia instance contains only 370 // same scale so that we can guarantee that a ImageSkia instance contains only
367 // one image rep per scale. This is not possible now as ImageLoader currently 371 // one image rep per scale. This is not possible now as ImageLoader currently
368 // stores need this feature, but this needs to be fixed. 372 // stores need this feature, but this needs to be fixed.
369 if (isNull()) { 373 if (isNull()) {
370 Init(image_rep); 374 Init(image_rep);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 bool ImageSkia::CanModify() const { 522 bool ImageSkia::CanModify() const {
519 return !storage_.get() || storage_->CanModify(); 523 return !storage_.get() || storage_->CanModify();
520 } 524 }
521 525
522 void ImageSkia::DetachStorageFromThread() { 526 void ImageSkia::DetachStorageFromThread() {
523 if (storage_.get()) 527 if (storage_.get())
524 storage_->DetachFromThread(); 528 storage_->DetachFromThread();
525 } 529 }
526 530
527 } // namespace gfx 531 } // 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