WebKit Bugzilla
Attachment 338946 Details for
Bug 184843
: tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-184843-20180426182742.patch (text/plain), 3.30 KB, created by
Justin Fan
on 2018-04-26 18:27:43 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Fan
Created:
2018-04-26 18:27:43 PDT
Size:
3.30 KB
patch
obsolete
>Subversion Revision: 230975 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f0554baff66a95598750dd84c228a8a1641dfd58..1b1a86a884eb93868bd33c52b7e3cff6ce4e5592 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-04-20 Justin Fan <justin_fan@apple.com> >+ >+ tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData. >+ https://bugs.webkit.org/show_bug.cgi?id=184843 >+ <rdar://problem/34898868> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ On certain test pages passing 2d canvas objects to gl.texSubImage2D, we spend significant time doing an alpha unpremultiplication in FormatConverter::convert on a single thread. >+ For now, I am introducing use of the Accelerate framework to do canvas alpha unpremultiplication, specifically for RGBA8 > RGBA8. >+ This improves this rendering path by a factor of ~4. The rest of FormatConverter could use similar improvements; filed https://bugs.webkit.org/show_bug.cgi?id=185064 for these. >+ >+ * platform/graphics/FormatConverter.cpp: >+ (WebCore::FormatConverter::convert): >+ > 2018-04-24 Basuke Suzuki <Basuke.Suzuki@sony.com> > > [Curl] Extract proxy settings into a separate class to hold advanced information. >diff --git a/Source/WebCore/platform/graphics/FormatConverter.cpp b/Source/WebCore/platform/graphics/FormatConverter.cpp >index 3fb9a7e4a6b02d1455da76cdbe4061d7e803a7e7..10e0d17baafabb5cecd3ad13fdf5ca6bf9ac3c5e 100644 >--- a/Source/WebCore/platform/graphics/FormatConverter.cpp >+++ b/Source/WebCore/platform/graphics/FormatConverter.cpp >@@ -35,6 +35,10 @@ > #include "GraphicsContext3DNEON.h" > #endif > >+#if USE(ACCELERATE) >+#include <Accelerate/Accelerate.h> >+#endif >+ > namespace WebCore { > > >@@ -1241,6 +1245,9 @@ ALWAYS_INLINE_EXCEPT_MSVC void FormatConverter::convert() > > const SrcType *srcRowStart = static_cast<const SrcType*>(m_srcStart); > DstType* dstRowStart = static_cast<DstType*>(m_dstStart); >+ >+ m_success = true; >+ > if (!trivialUnpack && trivialPack) { > for (size_t i = 0; i < m_height; ++i) { > unpack<SrcFormat>(srcRowStart, dstRowStart, m_width); >@@ -1255,14 +1262,33 @@ ALWAYS_INLINE_EXCEPT_MSVC void FormatConverter::convert() > dstRowStart += dstStrideInElements; > } > } else { >+#if USE(ACCELERATE) >+ if (SrcFormat == GraphicsContext3D::DataFormatRGBA8 >+ && DstFormat == GraphicsContext3D::DataFormatRGBA8 >+ && alphaOp == GraphicsContext3D::AlphaDoUnmultiply) { >+ vImage_Buffer src; >+ src.width = m_width; >+ src.height = m_height; >+ src.rowBytes = m_srcStride; >+ src.data = const_cast<void*>(m_srcStart); >+ >+ vImage_Buffer dst; >+ dst.width = m_width; >+ dst.height = m_height; >+ dst.rowBytes = m_dstStride; >+ dst.data = m_dstStart; >+ >+ vImageUnpremultiplyData_RGBA8888(&src, &dst, kvImageNoFlags); >+ >+ return; >+ } >+#endif > for (size_t i = 0; i < m_height; ++i) { > pack<DstFormat, alphaOp>(srcRowStart, dstRowStart, m_width); > srcRowStart += srcStrideInElements; > dstRowStart += dstStrideInElements; > } > } >- m_success = true; >- return; > } > > } // namespace WebCore
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 184843
:
338475
|
338489
|
338501
|
338506
|
338512
|
338682
| 338946