summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 01:54:06 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 01:54:06 +0000
commita9a430111290193028dc2b39be75c176d49d7bd3 (patch)
tree4b28a94aed9596ff8bcaf5f67b1e9273ece1c40f /gpu
parent0f8805d56674fff8ef79abd0981a3ede8b79190d (diff)
downloadchromium_src-a9a430111290193028dc2b39be75c176d49d7bd3.zip
chromium_src-a9a430111290193028dc2b39be75c176d49d7bd3.tar.gz
chromium_src-a9a430111290193028dc2b39be75c176d49d7bd3.tar.bz2
Revert 65152 - Integrated Pepper3D v2 with the accelerated compositor.
- It now uses GGL instead of a child window. - Fixed a bug where GLES2 decoder set texture state without updating TextureInfo. - Fixed Pepper3D demos and added awesome 3D CSS programmer art. - Removed ggl::GetCurrentContext to prevent further abuse. Fixed said abuse :) - GGL exposes GLES2Implementation to allow issue of GL calls on a particular context without making that context globally current. - Removed redundant "this context" argument from GGL SwapBuffers completion callback. - Temporarily removed context lost notification. I need to figure out the best semantics. TEST=Run Pepper3D and WebGL demos and YouTube videos on Windows and Mac. BUG=none Review URL: http://codereview.chromium.org/3531008 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/4561001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc5
-rw-r--r--gpu/demos/demos.gyp2
-rw-r--r--gpu/demos/framework/pepper.cc45
-rw-r--r--gpu/demos/pepper_gpu_demo.html6
4 files changed, 33 insertions, 25 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 44f97e3..8f0d96b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1511,6 +1511,11 @@ bool Texture::AllocateStorage(const gfx::Size& size, GLenum format) {
DCHECK_NE(id_, 0u);
ScopedGLErrorSuppressor suppressor(decoder_);
ScopedTexture2DBinder binder(decoder_, id_);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(
+ GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D,
0, // mip level
diff --git a/gpu/demos/demos.gyp b/gpu/demos/demos.gyp
index bae7503..d205eea 100644
--- a/gpu/demos/demos.gyp
+++ b/gpu/demos/demos.gyp
@@ -156,6 +156,7 @@
['OS=="mac"', {
'action': [
'<(PRODUCT_DIR)/Chromium.app/Contents/MacOS/Chromium',
+ '--enable-gpu-plugin',
'--register-pepper-plugins='
'<(PRODUCT_DIR)/$(PRODUCT_NAME).plugin;'
'pepper-application/x-gpu-demo',
@@ -164,6 +165,7 @@
}, { # OS != "mac"
'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)',
+ '--enable-gpu-plugin',
'--register-pepper-plugins=$(TargetPath);'
'pepper-application/x-gpu-demo',
'file://$(ProjectDir)pepper_gpu_demo.html',
diff --git a/gpu/demos/framework/pepper.cc b/gpu/demos/framework/pepper.cc
index 2d3d50b..9bcf9b1 100644
--- a/gpu/demos/framework/pepper.cc
+++ b/gpu/demos/framework/pepper.cc
@@ -35,31 +35,32 @@ class PluginInstance : public pp::Instance {
}
}
- virtual void DidChangeView(const pp::Rect& position,
- const pp::Rect& /*clip*/) {
- if (size_ == position.size())
- return;
-
- size_ = position.size();
- demo_->InitWindowSize(size_.width(), size_.height());
-
- if (graphics_.is_null()) {
+ virtual void ViewChanged(const pp::Rect& position, const pp::Rect& /*clip*/) {
+ if (size_.IsEmpty() && !position.IsEmpty()) {
+ size_ = position.size();
+ demo_->InitWindowSize(size_.width(), size_.height());
graphics_ = pp::Graphics3D_Dev(*this, 0, NULL, NULL);
- if (graphics_.is_null())
- return;
-
- if (!pp::Instance::BindGraphics(graphics_))
- return;
-
- graphics_.MakeCurrent();
- demo_->InitGL();
- pp::Graphics3D_Dev::ResetCurrent();
+ if (!graphics_.is_null()) {
+ graphics_.MakeCurrent();
+ demo_->InitGL();
+ pp::Graphics3D_Dev::ResetCurrent();
+
+ // TODO(neb): Remove this once the startup order bug (51842) is fixed.
+ if (true)
+ // if (demo_->IsAnimated())
+ Animate(0);
+ else
+ Paint();
+ }
}
+ }
- if (demo_->IsAnimated())
- Animate(0);
- else
- Paint();
+ virtual void Graphics3DContextLost() {
+ // TODO(neb): Replace this with the correct code once 53889 is fixed.
+ Paint();
+// pp::Rect fake_position(size_);
+// size_ = pp::Size();
+// ViewChanged(fake_position, fake_position);
}
void Paint() {
diff --git a/gpu/demos/pepper_gpu_demo.html b/gpu/demos/pepper_gpu_demo.html
index 64d88f7..8be4e57 100644
--- a/gpu/demos/pepper_gpu_demo.html
+++ b/gpu/demos/pepper_gpu_demo.html
@@ -3,10 +3,10 @@
<title>Pepper GPU Demo</title>
</head>
-<body style="background-color:Silver; -webkit-perspective: 1000;">
+<body style="background-color:Silver">
<h1>Pepper GPU Demo</h1>
-<embed id="plugin" type="pepper-application/x-gpu-demo" width="512" height="512" style="position:absolute; top: 30px; -webkit-transform: rotateY(30deg);" />
-<p style="position:absolute; top: 256px;">Text on top</p>
+<object id="plugin" type="pepper-application/x-gpu-demo" width="512" height="512" />
+
</body>
</html>