diff options
author | Steve Block <steveblock@google.com> | 2009-10-08 17:19:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:58 +0100 |
commit | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch) | |
tree | a6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp | |
parent | e196732677050bd463301566a68a643b6d14b907 (diff) | |
download | external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2 |
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp')
-rw-r--r-- | WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp | 92 |
1 files changed, 1 insertions, 91 deletions
diff --git a/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp b/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp index 3542cc2..dc120e3 100644 --- a/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp +++ b/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp @@ -28,104 +28,14 @@ #include <Bitmap.h> - namespace WebCore { -RGBA32Buffer::RGBA32Buffer() - : m_hasAlpha(false) - , m_status(FrameEmpty) - , m_duration(0) - , m_disposalMethod(DisposeNotSpecified) -{ -} - -void RGBA32Buffer::clear() -{ - m_bytes.clear(); - m_status = FrameEmpty; - // NOTE: Do not reset other members here; clearFrameBufferCache() - // calls this to free the bitmap data, but other functions like - // initFrameBuffer() and frameComplete() may still need to read - // other metadata out of this frame later. -} - -void RGBA32Buffer::zeroFill() -{ - m_bytes.fill(0); - m_hasAlpha = true; -} - -void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other) -{ - if (this == &other) - return; - - m_bytes = other.m_bytes; - setHasAlpha(other.m_hasAlpha); -} - -bool RGBA32Buffer::setSize(int newWidth, int newHeight) -{ - // NOTE: This has no way to check for allocation failure if the - // requested size was too big... - m_bytes.resize(newWidth * newHeight); - m_size = IntSize(newWidth, newHeight); - - // Zero the image. - zeroFill(); - - return true; -} - NativeImagePtr RGBA32Buffer::asNewNativeImage() const { - const void* bytes = m_bytes.data(); - BBitmap* bmp = new BBitmap(BRect(0, 0, width(), height()), B_RGB32); - bmp->SetBits(bytes, m_size.width() * m_size.height(), 0, B_RGB32); - + bmp->SetBits(m_bytes.data(), m_size.width() * m_size.height(), 0, B_RGB32); return bmp; } -bool RGBA32Buffer::hasAlpha() const -{ - return m_hasAlpha; -} - -void RGBA32Buffer::setHasAlpha(bool alpha) -{ - m_hasAlpha = alpha; -} - -void RGBA32Buffer::setStatus(FrameStatus status) -{ - m_status = status; -} - -RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other) -{ - if (this == &other) - return *this; - - m_bytes = other.m_bytes; - m_size = other.m_size; - setHasAlpha(other.hasAlpha()); - setRect(other.rect()); - setStatus(other.status()); - setDuration(other.duration()); - setDisposalMethod(other.disposalMethod()); - return *this; -} - -int RGBA32Buffer::width() const -{ - return m_size.width(); -} - -int RGBA32Buffer::height() const -{ - return m_size.height(); -} - } // namespace WebCore |