| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED; | 74 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED; |
| 75 public: | 75 public: |
| 76 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu
e); | 76 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu
e); |
| 77 static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>); | 77 static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>); |
| 78 | 78 |
| 79 ~ImageBuffer(); | 79 ~ImageBuffer(); |
| 80 | 80 |
| 81 const IntSize& size() const { return m_surface->size(); } | 81 const IntSize& size() const { return m_surface->size(); } |
| 82 bool isAccelerated() const { return m_surface->isAccelerated(); } | 82 bool isAccelerated() const { return m_surface->isAccelerated(); } |
| 83 | 83 |
| 84 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); } |
| 85 |
| 84 GraphicsContext* context() const; | 86 GraphicsContext* context() const; |
| 85 | 87 |
| 86 const SkBitmap& bitmap() const; | 88 const SkBitmap& bitmap() const; |
| 87 | 89 |
| 88 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavi
or = Scaled) const; | 90 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavi
or = Scaled) const; |
| 89 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if i
t supports the DontCopyBackingStore behavior | 91 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if i
t supports the DontCopyBackingStore behavior |
| 90 // or return CopyBackingStore if it doesn't. | 92 // or return CopyBackingStore if it doesn't. |
| 91 static BackingStoreCopy fastCopyImageMode(); | 93 static BackingStoreCopy fastCopyImageMode(); |
| 92 | 94 |
| 93 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&) const
; | 95 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&) const
; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 137 |
| 136 IntSize m_size; | 138 IntSize m_size; |
| 137 RefPtr<Uint8ClampedArray> m_data; | 139 RefPtr<Uint8ClampedArray> m_data; |
| 138 }; | 140 }; |
| 139 | 141 |
| 140 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String&
mimeType, const double* quality); | 142 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String&
mimeType, const double* quality); |
| 141 | 143 |
| 142 } // namespace WebCore | 144 } // namespace WebCore |
| 143 | 145 |
| 144 #endif // ImageBuffer_h | 146 #endif // ImageBuffer_h |
| OLD | NEW |