Changeset 231638 in webkit
- Timestamp:
- May 10, 2018 7:50:41 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r231636 r231638 1 2018-05-10 Thibault Saunier <tsaunier@igalia.com> 2 3 [GTK] Implement ImageBuffer::toBGRAData 4 https://bugs.webkit.org/show_bug.cgi?id=185511 5 6 Reviewed by Michael Catanzaro. 7 8 This was never implemented but will be required for the MediaStream API 9 tests. 10 11 * platform/graphics/ImageBuffer.cpp: 12 (WebCore::ImageBuffer::toBGRAData const): 13 * platform/graphics/cg/ImageBufferCG.cpp: 14 (WebCore::ImageBuffer::toBGRAData const): 15 * platform/graphics/gtk/ImageBufferGtk.cpp: 16 (WebCore::ImageBuffer::toBGRAData const): 17 1 18 2018-05-10 Yacine Bandou <yacine.bandou_ext@softathome.com> 2 19 -
trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp
r226315 r231638 103 103 } 104 104 105 #if !USE(CG) && !PLATFORM(GTK) 105 106 Vector<uint8_t> ImageBuffer::toBGRAData() const 106 107 { 107 #if USE(CG)108 if (context().isAcceleratedContext())109 flushContext();110 return m_data.toBGRAData(context().isAcceleratedContext(), m_size.width(), m_size.height());111 #else112 108 // FIXME: Implement this for other backends. 113 109 return { }; 114 #endif 115 } 110 } 111 #endif 116 112 117 113 #if !(USE(CG) || USE(DIRECT2D)) -
trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
r228853 r231638 631 631 } 632 632 633 Vector<uint8_t> ImageBuffer::toBGRAData() const 634 { 635 if (context().isAcceleratedContext()) 636 flushContext(); 637 return m_data.toBGRAData(context().isAcceleratedContext(), m_size.width(), m_size.height()); 638 } 639 633 640 } // namespace WebCore 634 641 -
trunk/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
r226425 r231638 21 21 22 22 #include "CairoUtilities.h" 23 #include "GRefPtrGtk.h" 23 24 #include "GdkCairoUtilities.h" 24 #include "GRefPtrGtk.h"25 25 #include "MIMETypeRegistry.h" 26 26 #include <cairo.h> … … 88 88 } 89 89 90 Vector<uint8_t> ImageBuffer::toBGRAData() const 91 { 92 auto pixbuf = adoptGRef(cairoSurfaceToGdkPixbuf(m_data.m_surface.get())); 93 auto pixels = gdk_pixbuf_get_pixels(pixbuf.get()); 94 95 Vector<uint8_t> imageData; 96 imageData.append(pixels, gdk_pixbuf_get_byte_length(pixbuf.get())); 97 return imageData; 98 } 99 90 100 Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double> quality) const 91 101 {
Note: See TracChangeset
for help on using the changeset viewer.