| OLD | NEW |
| 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.h" | 5 #include "ui/gfx/image/image.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 NSImage* image = ToNSImage(); | 323 NSImage* image = ToNSImage(); |
| 324 base::mac::NSObjectRetain(image); | 324 base::mac::NSObjectRetain(image); |
| 325 return image; | 325 return image; |
| 326 } | 326 } |
| 327 #endif | 327 #endif |
| 328 | 328 |
| 329 Image::operator const SkBitmap&() const { | 329 Image::operator const SkBitmap&() const { |
| 330 return *ToSkBitmap(); | 330 return *ToSkBitmap(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 #if defined(TOOLKIT_USES_GTK) | |
| 334 Image::operator GdkPixbuf*() const { | |
| 335 return ToGdkPixbuf(); | |
| 336 } | |
| 337 #endif | |
| 338 | |
| 339 #if defined(OS_MACOSX) | 333 #if defined(OS_MACOSX) |
| 340 Image::operator NSImage*() const { | 334 Image::operator NSImage*() const { |
| 341 return ToNSImage(); | 335 return ToNSImage(); |
| 342 } | 336 } |
| 343 #endif | 337 #endif |
| 344 | 338 |
| 345 bool Image::HasRepresentation(RepresentationType type) const { | 339 bool Image::HasRepresentation(RepresentationType type) const { |
| 346 return storage_.get() && storage_->representations().count(type) != 0; | 340 return storage_.get() && storage_->representations().count(type) != 0; |
| 347 } | 341 } |
| 348 | 342 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> | 455 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> |
| 462 bitmaps().size(); | 456 bitmaps().size(); |
| 463 } | 457 } |
| 464 | 458 |
| 465 const SkBitmap* Image::GetSkBitmapAtIndex(size_t index) const { | 459 const SkBitmap* Image::GetSkBitmapAtIndex(size_t index) const { |
| 466 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> | 460 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> |
| 467 bitmaps()[index]; | 461 bitmaps()[index]; |
| 468 } | 462 } |
| 469 | 463 |
| 470 } // namespace gfx | 464 } // namespace gfx |
| OLD | NEW |