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

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

Issue 10880063: image: Remove operator for converting from SkBitmap to ImageSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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') | 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 <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 154
155 ImageSkia::ImageSkia(const ImageSkia& other) : storage_(other.storage_) { 155 ImageSkia::ImageSkia(const ImageSkia& other) : storage_(other.storage_) {
156 } 156 }
157 157
158 ImageSkia& ImageSkia::operator=(const ImageSkia& other) { 158 ImageSkia& ImageSkia::operator=(const ImageSkia& other) {
159 storage_ = other.storage_; 159 storage_ = other.storage_;
160 return *this; 160 return *this;
161 } 161 }
162 162
163 ImageSkia& ImageSkia::operator=(const SkBitmap& other) {
164 Init(ImageSkiaRep(other, ui::SCALE_FACTOR_100P));
165 return *this;
166 }
167
168 ImageSkia::~ImageSkia() { 163 ImageSkia::~ImageSkia() {
169 } 164 }
170 165
171 bool ImageSkia::BackedBySameObjectAs(const gfx::ImageSkia& other) const { 166 bool ImageSkia::BackedBySameObjectAs(const gfx::ImageSkia& other) const {
172 return storage_.get() == other.storage_.get(); 167 return storage_.get() == other.storage_.get();
173 } 168 }
174 169
175 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) { 170 void ImageSkia::AddRepresentation(const ImageSkiaRep& image_rep) {
176 DCHECK(!image_rep.is_null()); 171 DCHECK(!image_rep.is_null());
177 172
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 280 }
286 281
287 ImageSkiaReps::iterator it = 282 ImageSkiaReps::iterator it =
288 storage_->FindRepresentation(ui::SCALE_FACTOR_100P, true); 283 storage_->FindRepresentation(ui::SCALE_FACTOR_100P, true);
289 if (it != storage_->image_reps().end()) 284 if (it != storage_->image_reps().end())
290 return it->mutable_sk_bitmap(); 285 return it->mutable_sk_bitmap();
291 return NullImageRep().mutable_sk_bitmap(); 286 return NullImageRep().mutable_sk_bitmap();
292 } 287 }
293 288
294 } // namespace gfx 289 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image_skia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698