[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
kbr at google.com
kbr at google.com
Wed Dec 22 13:29:48 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 944de52cef93d7a5335e5851c850edadaa01814a
Author: kbr at google.com <kbr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 17 01:53:40 2010 +0000
2010-09-16 Kenneth Russell <kbr at google.com>
Reviewed by James Robinson.
Add entry points to GraphicsContext3D needed for Chromium compositor port
https://bugs.webkit.org/show_bug.cgi?id=45939
Added entry points for two Chromium-specific extensions, and added
a flag to the GraphicsContext3D constructor, currently unsupported
by all ports (including Chromium), indicating whether the context
should render directly to the passed HostWindow or off-screen per
the current semantics. The switch to use GraphicsContext3D in
Chromium's compositor will follow in a subsequent patch.
No new tests; functionality is unchanged. Built and tested
Chromium and WebKit on Mac OS X.
* src/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::create):
* src/GraphicsContext3DInternal.h:
2010-09-16 Kenneth Russell <kbr at google.com>
Reviewed by James Robinson.
Add entry points to GraphicsContext3D needed for Chromium compositor port
https://bugs.webkit.org/show_bug.cgi?id=45939
Added entry points for two Chromium-specific extensions, and added
a flag to the GraphicsContext3D constructor, currently unsupported
by all ports (including Chromium), indicating whether the context
should render directly to the passed HostWindow or off-screen per
the current semantics. The switch to use GraphicsContext3D in
Chromium's compositor will follow in a subsequent patch.
No new tests; functionality is unchanged. Built and tested
Chromium and WebKit on Mac OS X.
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::supportsMapSubCHROMIUM):
(WebCore::GraphicsContext3D::mapBufferSubDataCHROMIUM):
(WebCore::GraphicsContext3D::unmapBufferSubDataCHROMIUM):
(WebCore::GraphicsContext3D::mapTexSubImage2DCHROMIUM):
(WebCore::GraphicsContext3D::unmapTexSubImage2DCHROMIUM):
(WebCore::GraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM):
(WebCore::GraphicsContext3D::copyTextureToParentTextureCHROMIUM):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cfef9f7..bffaa02 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,36 @@
+2010-09-16 Kenneth Russell <kbr at google.com>
+
+ Reviewed by James Robinson.
+
+ Add entry points to GraphicsContext3D needed for Chromium compositor port
+ https://bugs.webkit.org/show_bug.cgi?id=45939
+
+ Added entry points for two Chromium-specific extensions, and added
+ a flag to the GraphicsContext3D constructor, currently unsupported
+ by all ports (including Chromium), indicating whether the context
+ should render directly to the passed HostWindow or off-screen per
+ the current semantics. The switch to use GraphicsContext3D in
+ Chromium's compositor will follow in a subsequent patch.
+
+ No new tests; functionality is unchanged. Built and tested
+ Chromium and WebKit on Mac OS X.
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::supportsMapSubCHROMIUM):
+ (WebCore::GraphicsContext3D::mapBufferSubDataCHROMIUM):
+ (WebCore::GraphicsContext3D::unmapBufferSubDataCHROMIUM):
+ (WebCore::GraphicsContext3D::mapTexSubImage2DCHROMIUM):
+ (WebCore::GraphicsContext3D::unmapTexSubImage2DCHROMIUM):
+ (WebCore::GraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM):
+ (WebCore::GraphicsContext3D::copyTextureToParentTextureCHROMIUM):
+ * platform/graphics/GraphicsContext3D.h:
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::create):
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::create):
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
2010-09-16 Simon Fraser <simon.fraser at apple.com>
Reviewed by James Robinson.
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 170bb84..2da5862 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -830,6 +830,40 @@ bool GraphicsContext3D::supportsBGRA()
// Returning false for now to be safe.
return false;
}
+
+bool GraphicsContext3D::supportsMapSubCHROMIUM()
+{
+ // We don't claim support for this extension at this time.
+ return false;
+}
+
+void* GraphicsContext3D::mapBufferSubDataCHROMIUM(unsigned, int, int, unsigned)
+{
+ return 0;
+}
+
+void GraphicsContext3D::unmapBufferSubDataCHROMIUM(const void*)
+{
+}
+
+void* GraphicsContext3D::mapTexSubImage2DCHROMIUM(unsigned, int, int, int, int, int, unsigned, unsigned, unsigned)
+{
+ return 0;
+}
+
+void GraphicsContext3D::unmapTexSubImage2DCHROMIUM(const void*)
+{
+}
+
+bool GraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM()
+{
+ // We don't claim support for this extension at this time.
+ return false;
+}
+
+void GraphicsContext3D::copyTextureToParentTextureCHROMIUM(unsigned, unsigned)
+{
+}
#endif
} // namespace WebCore
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index b583813..bcb7997 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -404,7 +404,12 @@ public:
UNPACK_FLIP_Y_WEBGL = 0x9240,
UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
- BGRA_EXT = 0x80E1
+ // GL_EXT_texture_format_BGRA8888
+ BGRA_EXT = 0x80E1,
+
+ // GL_CHROMIUM_map_sub (enums inherited from GL_ARB_vertex_buffer_object)
+ READ_ONLY = 0x88B8,
+ WRITE_ONLY = 0x88B9
};
// Context creation attributes.
@@ -425,7 +430,12 @@ public:
bool premultipliedAlpha;
};
- static PassOwnPtr<GraphicsContext3D> create(Attributes attrs, HostWindow* hostWindow);
+ enum RenderStyle {
+ RenderOffscreen,
+ RenderDirectlyToHostWindow
+ };
+
+ static PassOwnPtr<GraphicsContext3D> create(Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle = RenderOffscreen);
virtual ~GraphicsContext3D();
#if PLATFORM(MAC)
@@ -751,10 +761,22 @@ public:
// getError in the order they were added.
void synthesizeGLError(unsigned long error);
+ // EXT_texture_format_BGRA8888
bool supportsBGRA();
+ // GL_CHROMIUM_map_sub
+ bool supportsMapSubCHROMIUM();
+ void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
+ void unmapBufferSubDataCHROMIUM(const void*);
+ void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
+ void unmapTexSubImage2DCHROMIUM(const void*);
+
+ // GL_CHROMIUM_copy_texture_to_parent_texture
+ bool supportsCopyTextureToParentTextureCHROMIUM();
+ void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
+
private:
- GraphicsContext3D(Attributes attrs, HostWindow* hostWindow);
+ GraphicsContext3D(Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow);
// Each platform must provide an implementation of this method.
//
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index 3fd4005..a4919d8 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -77,13 +77,16 @@ static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBi
attribs.append(static_cast<CGLPixelFormatAttribute>(0));
}
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
- OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow));
+ // This implementation doesn't currently support rendering directly to the HostWindow.
+ if (renderStyle == RenderDirectlyToHostWindow)
+ return 0;
+ OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow, false));
return context->m_contextObj ? context.release() : 0;
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
: m_currentWidth(0)
, m_currentHeight(0)
, m_attrs(attrs)
diff --git a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index 7918378..0756aa7 100644
--- a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -491,13 +491,16 @@ void* GraphicsContext3DInternal::getProcAddress(const String& proc)
return 0;
}
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
- OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow));
+ // This implementation doesn't currently support rendering directly to the HostWindow.
+ if (renderStyle == RenderDirectlyToHostWindow)
+ return 0;
+ OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow, false));
return context->m_internal ? context.release() : 0;
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
: m_internal(new GraphicsContext3DInternal(attrs, hostWindow))
{
if (!m_internal->isContextValid())
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index afb45c1..1e98df0 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -2,6 +2,28 @@
Reviewed by James Robinson.
+ Add entry points to GraphicsContext3D needed for Chromium compositor port
+ https://bugs.webkit.org/show_bug.cgi?id=45939
+
+ Added entry points for two Chromium-specific extensions, and added
+ a flag to the GraphicsContext3D constructor, currently unsupported
+ by all ports (including Chromium), indicating whether the context
+ should render directly to the passed HostWindow or off-screen per
+ the current semantics. The switch to use GraphicsContext3D in
+ Chromium's compositor will follow in a subsequent patch.
+
+ No new tests; functionality is unchanged. Built and tested
+ Chromium and WebKit on Mac OS X.
+
+ * src/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+ (WebCore::GraphicsContext3D::create):
+ * src/GraphicsContext3DInternal.h:
+
+2010-09-16 Kenneth Russell <kbr at google.com>
+
+ Reviewed by James Robinson.
+
[chromium] Add needed entry points to WebGraphicsContext3D for compositor
https://bugs.webkit.org/show_bug.cgi?id=45921
diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp
index caead2b..027b4e4 100644
--- a/WebKit/chromium/src/GraphicsContext3D.cpp
+++ b/WebKit/chromium/src/GraphicsContext3D.cpp
@@ -61,8 +61,6 @@
#include <CoreGraphics/CGImage.h>
#endif
-// using namespace std;
-
// There are two levels of delegation in this file:
//
// 1. GraphicsContext3D delegates to GraphicsContext3DInternal. This is done
@@ -80,6 +78,9 @@
namespace WebCore {
+//----------------------------------------------------------------------
+// GraphicsContext3DInternal
+
GraphicsContext3DInternal::GraphicsContext3DInternal()
: m_webViewImpl(0)
#if PLATFORM(SKIA)
@@ -293,6 +294,12 @@ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \
m_impl->name(a1, a2, a3, a4); \
}
+#define DELEGATE_TO_IMPL_4R(name, t1, t2, t3, t4, rt) \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \
+{ \
+ return m_impl->name(a1, a2, a3, a4); \
+}
+
#define DELEGATE_TO_IMPL_5(name, t1, t2, t3, t4, t5) \
void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \
{ \
@@ -663,6 +670,13 @@ DELEGATE_TO_IMPL_1(deleteTexture, unsigned)
DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long)
DELEGATE_TO_IMPL_R(supportsBGRA, bool)
+DELEGATE_TO_IMPL_R(supportsMapSubCHROMIUM, bool)
+DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*)
+DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*)
+DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*)
+DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*)
+DELEGATE_TO_IMPL_R(supportsCopyTextureToParentTextureCHROMIUM, bool)
+DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned)
//----------------------------------------------------------------------
// GraphicsContext3D
@@ -725,6 +739,12 @@ void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
m_internal->name(a1, a2, a3, a4); \
}
+#define DELEGATE_TO_INTERNAL_4R(name, t1, t2, t3, t4, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
+{ \
+ return m_internal->name(a1, a2, a3, a4); \
+}
+
#define DELEGATE_TO_INTERNAL_5(name, t1, t2, t3, t4, t5) \
void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \
{ \
@@ -767,7 +787,7 @@ rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a
return m_internal->name(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*, bool)
{
}
@@ -775,15 +795,17 @@ GraphicsContext3D::~GraphicsContext3D()
{
}
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
- GraphicsContext3DInternal* internal = new GraphicsContext3DInternal();
+ // FIXME: must pass down renderStyle argument when switching compositor to GraphicsContext3D.
+ if (renderStyle == RenderDirectlyToHostWindow)
+ return 0;
+ OwnPtr<GraphicsContext3DInternal> internal = adoptPtr(new GraphicsContext3DInternal());
if (!internal->initialize(attrs, hostWindow)) {
- delete internal;
return 0;
}
- PassOwnPtr<GraphicsContext3D> result = new GraphicsContext3D(attrs, hostWindow);
- result->m_internal.set(internal);
+ PassOwnPtr<GraphicsContext3D> result = new GraphicsContext3D(attrs, hostWindow, false);
+ result->m_internal = internal.release();
return result;
}
@@ -999,6 +1021,13 @@ DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned)
DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long)
DELEGATE_TO_INTERNAL_R(supportsBGRA, bool)
+DELEGATE_TO_INTERNAL_R(supportsMapSubCHROMIUM, bool)
+DELEGATE_TO_INTERNAL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*)
+DELEGATE_TO_INTERNAL_1(unmapBufferSubDataCHROMIUM, const void*)
+DELEGATE_TO_INTERNAL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*)
+DELEGATE_TO_INTERNAL_1(unmapTexSubImage2DCHROMIUM, const void*)
+DELEGATE_TO_INTERNAL_R(supportsCopyTextureToParentTextureCHROMIUM, bool)
+DELEGATE_TO_INTERNAL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned)
bool GraphicsContext3D::isGLES2Compliant() const
{
diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h
index fb48525..c2393fc 100644
--- a/WebKit/chromium/src/GraphicsContext3DInternal.h
+++ b/WebKit/chromium/src/GraphicsContext3DInternal.h
@@ -257,8 +257,20 @@ public:
void swapBuffers();
+ // EXT_texture_format_BGRA8888
bool supportsBGRA();
+ // GL_CHROMIUM_map_sub
+ bool supportsMapSubCHROMIUM();
+ void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
+ void unmapBufferSubDataCHROMIUM(const void*);
+ void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
+ void unmapTexSubImage2DCHROMIUM(const void*);
+
+ // GL_CHROMIUM_copy_texture_to_parent_texture
+ bool supportsCopyTextureToParentTextureCHROMIUM();
+ void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
+
private:
OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
WebKit::WebViewImpl* m_webViewImpl;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list