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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 300 } |
301 #endif | 301 #endif |
302 | 302 |
303 #if defined(OS_MACOSX) | 303 #if defined(OS_MACOSX) |
304 NSImage* Image::ToNSImage() const { | 304 NSImage* Image::ToNSImage() const { |
305 internal::ImageRep* rep = GetRepresentation(Image::kImageRepCocoa); | 305 internal::ImageRep* rep = GetRepresentation(Image::kImageRepCocoa); |
306 return rep->AsImageRepCocoa()->image(); | 306 return rep->AsImageRepCocoa()->image(); |
307 } | 307 } |
308 #endif | 308 #endif |
309 | 309 |
310 const SkBitmap* Image::CopySkBitmap() const { | 310 SkBitmap* Image::CopySkBitmap() const { |
311 return new SkBitmap(*ToSkBitmap()); | 311 return new SkBitmap(*ToSkBitmap()); |
312 } | 312 } |
313 | 313 |
314 #if defined(TOOLKIT_USES_GTK) | 314 #if defined(TOOLKIT_USES_GTK) |
315 GdkPixbuf* Image::CopyGdkPixbuf() const { | 315 GdkPixbuf* Image::CopyGdkPixbuf() const { |
316 GdkPixbuf* pixbuf = ToGdkPixbuf(); | 316 GdkPixbuf* pixbuf = ToGdkPixbuf(); |
317 g_object_ref(pixbuf); | 317 g_object_ref(pixbuf); |
318 return pixbuf; | 318 return pixbuf; |
319 } | 319 } |
320 #endif | 320 #endif |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> | 466 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> |
467 bitmaps().size(); | 467 bitmaps().size(); |
468 } | 468 } |
469 | 469 |
470 const SkBitmap* Image::GetSkBitmapAtIndex(size_t index) const { | 470 const SkBitmap* Image::GetSkBitmapAtIndex(size_t index) const { |
471 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> | 471 return GetRepresentation(Image::kImageRepSkia)->AsImageRepSkia()-> |
472 bitmaps()[index]; | 472 bitmaps()[index]; |
473 } | 473 } |
474 | 474 |
475 } // namespace gfx | 475 } // namespace gfx |
OLD | NEW |