WebKit Bugzilla
Attachment 340086 Details for
Bug 185511
: [GTK] Implement ImageBuffer::toBGRAData
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[GTK] Implement ImageBuffer::toBGRAData
GTK-Implement-ImageBuffertoBGRAData.patch (text/plain), 3.18 KB, created by
Thibault Saunier
on 2018-05-10 05:49:58 PDT
(
hide
)
Description:
[GTK] Implement ImageBuffer::toBGRAData
Filename:
MIME Type:
Creator:
Thibault Saunier
Created:
2018-05-10 05:49:58 PDT
Size:
3.18 KB
patch
obsolete
>From 642dcdeff9a4280d66b9c63ae250e5cb318a20a0 Mon Sep 17 00:00:00 2001 >From: Thibault Saunier <tsaunier@igalia.com> >Date: Wed, 25 Apr 2018 11:59:59 -0300 >Subject: [PATCH xserver] [GTK] Implement ImageBuffer::toBGRAData > >This was never implemented but will is required for the MediaStream API >tests. > >https://bugs.webkit.org/show_bug.cgi?id=185511 >--- > Source/WebCore/ChangeLog | 16 ++++++++++++++++ > Source/WebCore/platform/graphics/ImageBuffer.cpp | 2 ++ > .../platform/graphics/gtk/ImageBufferGtk.cpp | 12 +++++++++++- > 3 files changed, 29 insertions(+), 1 deletion(-) > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a034a0e7511..0bc89e23112 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-05-10 Thibault Saunier <tsaunier@igalia.com> >+ >+ [GTK] Implement ImageBuffer::toBGRAData >+ https://bugs.webkit.org/show_bug.cgi?id=185511 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ [GTK] Implement ImageBuffer::toBGRAData >+ >+ This was never implemented but will is required for the MediaStream API >+ tests. >+ >+ * platform/graphics/ImageBuffer.cpp: >+ * platform/graphics/gtk/ImageBufferGtk.cpp: >+ (WebCore::ImageBuffer::toBGRAData const): >+ > 2018-05-10 Thibault Saunier <tsaunier@igalia.com> > > [GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase >diff --git a/Source/WebCore/platform/graphics/ImageBuffer.cpp b/Source/WebCore/platform/graphics/ImageBuffer.cpp >index 4145b2b8f1e..11c91bcdc6e 100644 >--- a/Source/WebCore/platform/graphics/ImageBuffer.cpp >+++ b/Source/WebCore/platform/graphics/ImageBuffer.cpp >@@ -102,6 +102,7 @@ FloatRect ImageBuffer::clampedRect(const FloatRect& rect) > return FloatRect(rect.location(), clampedSize(rect.size())); > } > >+#if USE(CG) && !PLATFORM(GTK) > Vector<uint8_t> ImageBuffer::toBGRAData() const > { > #if USE(CG) >@@ -113,6 +114,7 @@ Vector<uint8_t> ImageBuffer::toBGRAData() const > return { }; > #endif > } >+#endif > > #if !(USE(CG) || USE(DIRECT2D)) > >diff --git a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >index b23e64769e9..ed3a11f913b 100644 >--- a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >+++ b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >@@ -20,8 +20,8 @@ > #include "ImageBuffer.h" > > #include "CairoUtilities.h" >-#include "GdkCairoUtilities.h" > #include "GRefPtrGtk.h" >+#include "GdkCairoUtilities.h" > #include "MIMETypeRegistry.h" > #include <cairo.h> > #include <gtk/gtk.h> >@@ -87,6 +87,16 @@ String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> qual > return "data:" + mimeType + ";base64," + base64Data; > } > >+Vector<uint8_t> ImageBuffer::toBGRAData() const >+{ >+ auto pixbuf = adoptGRef(cairoSurfaceToGdkPixbuf(m_data.m_surface.get())); >+ auto pixels = gdk_pixbuf_get_pixels(pixbuf.get()); >+ >+ Vector<uint8_t> imageData; >+ imageData.append(pixels, gdk_pixbuf_get_byte_length(pixbuf.get())); >+ return imageData; >+} >+ > Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double> quality) const > { > ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); >-- >2.17.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185511
:
340086
|
340087
|
340088