[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
cmarrin at apple.com
cmarrin at apple.com
Wed Apr 7 23:55:25 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit fa8b4fcab3011f45de1bb21745cbbd59061fd5eb
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 24 20:18:15 2009 +0000
Didn't add these files to http://trac.webkit.org/changeset/51348
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/canvas/WebGLGetInfo.cpp b/WebCore/html/canvas/WebGLGetInfo.cpp
new file mode 100644
index 0000000..96218e5
--- /dev/null
+++ b/WebCore/html/canvas/WebGLGetInfo.cpp
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(3D_CANVAS)
+
+#include "WebGLGetInfo.h"
+#include "WebGLBuffer.h"
+#include "WebGLFloatArray.h"
+#include "WebGLFramebuffer.h"
+#include "WebGLIntArray.h"
+#include "WebGLProgram.h"
+#include "WebGLRenderbuffer.h"
+#include "WebGLTexture.h"
+#include "WebGLUnsignedByteArray.h"
+
+namespace WebCore {
+
+WebGLGetInfo::WebGLGetInfo(bool value)
+ : m_type(kTypeBool)
+ , m_bool(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(float value)
+ : m_type(kTypeFloat)
+ , m_float(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(long value)
+ : m_type(kTypeLong)
+ , m_long(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo()
+ : m_type(kTypeNull)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(const String& value)
+ : m_type(kTypeString)
+ , m_string(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(unsigned long value)
+ : m_type(kTypeUnsignedLong)
+ , m_unsignedLong(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLBuffer> value)
+ : m_type(kTypeWebGLBuffer)
+ , m_webglBuffer(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLFloatArray> value)
+ : m_type(kTypeWebGLFloatArray)
+ , m_webglFloatArray(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLFramebuffer> value)
+ : m_type(kTypeWebGLFramebuffer)
+ , m_webglFramebuffer(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLIntArray> value)
+ : m_type(kTypeWebGLIntArray)
+ , m_webglIntArray(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLProgram> value)
+ : m_type(kTypeWebGLProgram)
+ , m_webglProgram(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLRenderbuffer> value)
+ : m_type(kTypeWebGLRenderbuffer)
+ , m_webglRenderbuffer(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLTexture> value)
+ : m_type(kTypeWebGLTexture)
+ , m_webglTexture(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLUnsignedByteArray> value)
+ : m_type(kTypeWebGLUnsignedByteArray)
+ , m_webglUnsignedByteArray(value)
+{
+}
+
+WebGLGetInfo::~WebGLGetInfo()
+{
+}
+
+WebGLGetInfo::Type WebGLGetInfo::getType() const
+{
+ return m_type;
+}
+
+bool WebGLGetInfo::getBool() const
+{
+ ASSERT(getType() == kTypeBool);
+ return m_bool;
+}
+
+float WebGLGetInfo::getFloat() const
+{
+ ASSERT(getType() == kTypeFloat);
+ return m_float;
+}
+
+long WebGLGetInfo::getLong() const
+{
+ ASSERT(getType() == kTypeLong);
+ return m_long;
+}
+
+const String& WebGLGetInfo::getString() const
+{
+ ASSERT(getType() == kTypeString);
+ return m_string;
+}
+
+unsigned long WebGLGetInfo::getUnsignedLong() const
+{
+ ASSERT(getType() == kTypeUnsignedLong);
+ return m_unsignedLong;
+}
+
+PassRefPtr<WebGLBuffer> WebGLGetInfo::getWebGLBuffer() const
+{
+ ASSERT(getType() == kTypeWebGLBuffer);
+ return m_webglBuffer;
+}
+
+PassRefPtr<WebGLFloatArray> WebGLGetInfo::getWebGLFloatArray() const
+{
+ ASSERT(getType() == kTypeWebGLFloatArray);
+ return m_webglFloatArray;
+}
+
+PassRefPtr<WebGLFramebuffer> WebGLGetInfo::getWebGLFramebuffer() const
+{
+ ASSERT(getType() == kTypeWebGLFramebuffer);
+ return m_webglFramebuffer;
+}
+
+PassRefPtr<WebGLIntArray> WebGLGetInfo::getWebGLIntArray() const
+{
+ ASSERT(getType() == kTypeWebGLIntArray);
+ return m_webglIntArray;
+}
+
+PassRefPtr<WebGLProgram> WebGLGetInfo::getWebGLProgram() const
+{
+ ASSERT(getType() == kTypeWebGLProgram);
+ return m_webglProgram;
+}
+
+PassRefPtr<WebGLRenderbuffer> WebGLGetInfo::getWebGLRenderbuffer() const
+{
+ ASSERT(getType() == kTypeWebGLRenderbuffer);
+ return m_webglRenderbuffer;
+}
+
+PassRefPtr<WebGLTexture> WebGLGetInfo::getWebGLTexture() const
+{
+ ASSERT(getType() == kTypeWebGLTexture);
+ return m_webglTexture;
+}
+
+PassRefPtr<WebGLUnsignedByteArray> WebGLGetInfo::getWebGLUnsignedByteArray() const
+{
+ ASSERT(getType() == kTypeWebGLUnsignedByteArray);
+ return m_webglUnsignedByteArray;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/html/canvas/WebGLGetInfo.h b/WebCore/html/canvas/WebGLGetInfo.h
new file mode 100644
index 0000000..8ac42c4
--- /dev/null
+++ b/WebCore/html/canvas/WebGLGetInfo.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebGLGetInfo_h
+#define WebGLGetInfo_h
+
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+#include "PlatformString.h"
+
+#include "WebGLBuffer.h"
+#include "WebGLFloatArray.h"
+#include "WebGLFramebuffer.h"
+#include "WebGLIntArray.h"
+// FIXME: implement WebGLObjectArray
+//#include "WebGLObjectArray.h"
+#include "WebGLProgram.h"
+#include "WebGLRenderbuffer.h"
+#include "WebGLTexture.h"
+#include "WebGLUnsignedByteArray.h"
+
+namespace WebCore {
+
+// A tagged union representing the result of get queries like
+// getParameter (encompassing getBooleanv, getIntegerv, getFloatv) and
+// similar variants. For reference counted types, increments and
+// decrements the reference count of the target object.
+
+class WebGLGetInfo {
+public:
+ enum Type {
+ kTypeBool,
+ kTypeFloat,
+ kTypeLong,
+ kTypeNull,
+ kTypeString,
+ kTypeUnsignedLong,
+ kTypeWebGLBuffer,
+ kTypeWebGLFloatArray,
+ kTypeWebGLFramebuffer,
+ kTypeWebGLIntArray,
+ kTypeWebGLObjectArray,
+ kTypeWebGLProgram,
+ kTypeWebGLRenderbuffer,
+ kTypeWebGLTexture,
+ kTypeWebGLUnsignedByteArray
+ };
+
+ WebGLGetInfo(bool value);
+ WebGLGetInfo(float value);
+ WebGLGetInfo(long value);
+ // Represents the NULL value and type
+ WebGLGetInfo();
+ WebGLGetInfo(const String& value);
+ WebGLGetInfo(unsigned long value);
+ WebGLGetInfo(PassRefPtr<WebGLBuffer> value);
+ WebGLGetInfo(PassRefPtr<WebGLFloatArray> value);
+ WebGLGetInfo(PassRefPtr<WebGLFramebuffer> value);
+ WebGLGetInfo(PassRefPtr<WebGLIntArray> value);
+ // FIXME: implement WebGLObjectArray
+ // WebGLGetInfo(PassRefPtr<WebGLObjectArray> value);
+ WebGLGetInfo(PassRefPtr<WebGLProgram> value);
+ WebGLGetInfo(PassRefPtr<WebGLRenderbuffer> value);
+ WebGLGetInfo(PassRefPtr<WebGLTexture> value);
+ WebGLGetInfo(PassRefPtr<WebGLUnsignedByteArray> value);
+
+ virtual ~WebGLGetInfo();
+
+ Type getType() const;
+
+ bool getBool() const;
+ float getFloat() const;
+ long getLong() const;
+ const String& getString() const;
+ unsigned long getUnsignedLong() const;
+ PassRefPtr<WebGLBuffer> getWebGLBuffer() const;
+ PassRefPtr<WebGLFloatArray> getWebGLFloatArray() const;
+ PassRefPtr<WebGLFramebuffer> getWebGLFramebuffer() const;
+ PassRefPtr<WebGLIntArray> getWebGLIntArray() const;
+ // FIXME: implement WebGLObjectArray
+ // PassRefPtr<WebGLObjectArray> getWebGLObjectArray() const;
+ PassRefPtr<WebGLProgram> getWebGLProgram() const;
+ PassRefPtr<WebGLRenderbuffer> getWebGLRenderbuffer() const;
+ PassRefPtr<WebGLTexture> getWebGLTexture() const;
+ PassRefPtr<WebGLUnsignedByteArray> getWebGLUnsignedByteArray() const;
+
+private:
+ Type m_type;
+ bool m_bool;
+ float m_float;
+ long m_long;
+ String m_string;
+ unsigned long m_unsignedLong;
+ RefPtr<WebGLBuffer> m_webglBuffer;
+ RefPtr<WebGLFloatArray> m_webglFloatArray;
+ RefPtr<WebGLFramebuffer> m_webglFramebuffer;
+ RefPtr<WebGLIntArray> m_webglIntArray;
+ // FIXME: implement WebGLObjectArray
+ // RefPtr<WebGLObjectArray> m_webglObjectArray;
+ RefPtr<WebGLProgram> m_webglProgram;
+ RefPtr<WebGLRenderbuffer> m_webglRenderbuffer;
+ RefPtr<WebGLTexture> m_webglTexture;
+ RefPtr<WebGLUnsignedByteArray> m_webglUnsignedByteArray;
+};
+
+} // namespace WebCore
+
+#endif // WebGLGetInfo_h
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list