summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 23:16:41 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 23:16:41 +0000
commitf17a37e3aa56908e421109995f8734742b22241a (patch)
treefd598d40c7588485a17f2acda4e7d9a614690a3f /webkit
parent8330481c1142312a73659394f5497539cc65311d (diff)
downloadchromium_src-f17a37e3aa56908e421109995f8734742b22241a.zip
chromium_src-f17a37e3aa56908e421109995f8734742b22241a.tar.gz
chromium_src-f17a37e3aa56908e421109995f8734742b22241a.tar.bz2
Remove WGC3D::width(), height(), reshape() implementations
These get removed from the interface in https://codereview.chromium.org/25450002/ as they are not used. BUG=181120 Review URL: https://codereview.chromium.org/25455002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc208
-rw-r--r--webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h5
2 files changed, 92 insertions, 121 deletions
diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index f468cf5..75e99ec 100644
--- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -127,8 +127,6 @@ WebGraphicsContext3DInProcessCommandBufferImpl::
context_lost_callback_(NULL),
context_lost_reason_(GL_NO_ERROR),
attributes_(attributes),
- cached_width_(0),
- cached_height_(0),
flush_id_(0) {
}
@@ -237,12 +235,99 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::ClearContext() {
// GLInProcessContext::MakeCurrent(NULL);
}
-int WebGraphicsContext3DInProcessCommandBufferImpl::width() {
- return cached_width_;
+// Helper macros to reduce the amount of code.
+
+#define DELEGATE_TO_GL(name, glname) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name() { \
+ ClearContext(); \
+ gl_->glname(); \
}
-int WebGraphicsContext3DInProcessCommandBufferImpl::height() {
- return cached_height_;
+#define DELEGATE_TO_GL_1(name, glname, t1) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1) { \
+ ClearContext(); \
+ gl_->glname(a1); \
+}
+
+#define DELEGATE_TO_GL_1R(name, glname, t1, rt) \
+rt WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1) { \
+ ClearContext(); \
+ return gl_->glname(a1); \
+}
+
+#define DELEGATE_TO_GL_1RB(name, glname, t1, rt) \
+rt WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1) { \
+ ClearContext(); \
+ return gl_->glname(a1) ? true : false; \
+}
+
+#define DELEGATE_TO_GL_2(name, glname, t1, t2) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2) { \
+ ClearContext(); \
+ gl_->glname(a1, a2); \
+}
+
+#define DELEGATE_TO_GL_2R(name, glname, t1, t2, rt) \
+rt WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1, t2 a2) { \
+ ClearContext(); \
+ return gl_->glname(a1, a2); \
+}
+
+#define DELEGATE_TO_GL_3(name, glname, t1, t2, t3) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3) { \
+ ClearContext(); \
+ gl_->glname(a1, a2, a3); \
+}
+
+#define DELEGATE_TO_GL_3R(name, glname, t1, t2, t3, rt) \
+rt WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3) { \
+ ClearContext(); \
+ return gl_->glname(a1, a2, a3); \
+}
+
+#define DELEGATE_TO_GL_4(name, glname, t1, t2, t3, t4) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3, t4 a4) { \
+ ClearContext(); \
+ gl_->glname(a1, a2, a3, a4); \
+}
+
+#define DELEGATE_TO_GL_5(name, glname, t1, t2, t3, t4, t5) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) { \
+ ClearContext(); \
+ gl_->glname(a1, a2, a3, a4, a5); \
+}
+
+#define DELEGATE_TO_GL_6(name, glname, t1, t2, t3, t4, t5, t6) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) { \
+ ClearContext(); \
+ gl_->glname(a1, a2, a3, a4, a5, a6); \
+}
+
+#define DELEGATE_TO_GL_7(name, glname, t1, t2, t3, t4, t5, t6, t7) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) { \
+ ClearContext(); \
+ gl_->glname(a1, a2, a3, a4, a5, a6, a7); \
+}
+
+#define DELEGATE_TO_GL_8(name, glname, t1, t2, t3, t4, t5, t6, t7, t8) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8) { \
+ ClearContext(); \
+ gl_->glname(a1, a2, a3, a4, a5, a6, a7, a8); \
+}
+
+#define DELEGATE_TO_GL_9(name, glname, t1, t2, t3, t4, t5, t6, t7, t8, t9) \
+void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
+ t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) { \
+ ClearContext(); \
+ gl_->glname(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
}
void WebGraphicsContext3DInProcessCommandBufferImpl::prepareTexture() {
@@ -257,21 +342,7 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::postSubBufferCHROMIUM(
gl_->PostSubBufferCHROMIUM(x, y, width, height);
}
-void WebGraphicsContext3DInProcessCommandBufferImpl::reshape(
- int width, int height) {
- reshapeWithScaleFactor(width, height, 1.0f);
-}
-
-void WebGraphicsContext3DInProcessCommandBufferImpl::reshapeWithScaleFactor(
- int width, int height, float scale_factor) {
- cached_width_ = width;
- cached_height_ = height;
-
- // TODO(gmam): See if we can comment this in.
- // ClearContext();
-
- gl_->ResizeCHROMIUM(width, height, scale_factor);
-}
+DELEGATE_TO_GL_3(reshapeWithScaleFactor, ResizeCHROMIUM, int, int, float)
void WebGraphicsContext3DInProcessCommandBufferImpl::synthesizeGLError(
WGC3Denum error) {
@@ -386,101 +457,6 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::
target, samples, internalformat, width, height);
}
-// Helper macros to reduce the amount of code.
-
-#define DELEGATE_TO_GL(name, glname) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name() { \
- ClearContext(); \
- gl_->glname(); \
-}
-
-#define DELEGATE_TO_GL_1(name, glname, t1) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1) { \
- ClearContext(); \
- gl_->glname(a1); \
-}
-
-#define DELEGATE_TO_GL_1R(name, glname, t1, rt) \
-rt WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1) { \
- ClearContext(); \
- return gl_->glname(a1); \
-}
-
-#define DELEGATE_TO_GL_1RB(name, glname, t1, rt) \
-rt WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1) { \
- ClearContext(); \
- return gl_->glname(a1) ? true : false; \
-}
-
-#define DELEGATE_TO_GL_2(name, glname, t1, t2) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2) { \
- ClearContext(); \
- gl_->glname(a1, a2); \
-}
-
-#define DELEGATE_TO_GL_2R(name, glname, t1, t2, rt) \
-rt WebGraphicsContext3DInProcessCommandBufferImpl::name(t1 a1, t2 a2) { \
- ClearContext(); \
- return gl_->glname(a1, a2); \
-}
-
-#define DELEGATE_TO_GL_3(name, glname, t1, t2, t3) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3) { \
- ClearContext(); \
- gl_->glname(a1, a2, a3); \
-}
-
-#define DELEGATE_TO_GL_3R(name, glname, t1, t2, t3, rt) \
-rt WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3) { \
- ClearContext(); \
- return gl_->glname(a1, a2, a3); \
-}
-
-#define DELEGATE_TO_GL_4(name, glname, t1, t2, t3, t4) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3, t4 a4) { \
- ClearContext(); \
- gl_->glname(a1, a2, a3, a4); \
-}
-
-#define DELEGATE_TO_GL_5(name, glname, t1, t2, t3, t4, t5) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) { \
- ClearContext(); \
- gl_->glname(a1, a2, a3, a4, a5); \
-}
-
-#define DELEGATE_TO_GL_6(name, glname, t1, t2, t3, t4, t5, t6) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) { \
- ClearContext(); \
- gl_->glname(a1, a2, a3, a4, a5, a6); \
-}
-
-#define DELEGATE_TO_GL_7(name, glname, t1, t2, t3, t4, t5, t6, t7) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) { \
- ClearContext(); \
- gl_->glname(a1, a2, a3, a4, a5, a6, a7); \
-}
-
-#define DELEGATE_TO_GL_8(name, glname, t1, t2, t3, t4, t5, t6, t7, t8) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8) { \
- ClearContext(); \
- gl_->glname(a1, a2, a3, a4, a5, a6, a7, a8); \
-}
-
-#define DELEGATE_TO_GL_9(name, glname, t1, t2, t3, t4, t5, t6, t7, t8, t9) \
-void WebGraphicsContext3DInProcessCommandBufferImpl::name( \
- t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) { \
- ClearContext(); \
- gl_->glname(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
-}
-
DELEGATE_TO_GL_1(activeTexture, ActiveTexture, WGC3Denum)
DELEGATE_TO_GL_2(attachShader, AttachShader, WebGLId, WebGLId)
diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h
index 03c07f0..e4e3b02 100644
--- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h
+++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h
@@ -76,10 +76,6 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
virtual uint32_t lastFlushID();
- virtual int width();
- virtual int height();
-
- virtual void reshape(int width, int height);
virtual void reshapeWithScaleFactor(int width, int height, float scaleFactor);
virtual void prepareTexture();
@@ -585,7 +581,6 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
WGC3Denum context_lost_reason_;
WebKit::WebGraphicsContext3D::Attributes attributes_;
- int cached_width_, cached_height_;
// Errors raised by synthesizeGLError().
std::vector<WGC3Denum> synthetic_errors_;