Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1524)

Unified Diff: content/renderer/render_widget_fullscreen_pepper.cc

Issue 11787006: Avoid going through WebWidget::composite to composite a RenderWidget (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget_fullscreen_pepper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget_fullscreen_pepper.cc
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc
index 85c2b77d9c9389e97f0b10ede8e542781e26ace5..5ce6a3bbf728e49e4764b4576d0922c39d2965cf 100644
--- a/content/renderer/render_widget_fullscreen_pepper.cc
+++ b/content/renderer/render_widget_fullscreen_pepper.cc
@@ -139,15 +139,6 @@ class PepperWidget : public WebWidget {
}
virtual void composite(bool finish) {
- if (!widget_->plugin())
- return;
-
- WebGraphicsContext3DCommandBufferImpl* context = widget_->context();
- DCHECK(context);
- unsigned int texture = widget_->plugin()->GetBackingTextureId();
- context->bindTexture(GL_TEXTURE_2D, texture);
- context->drawArrays(GL_TRIANGLES, 0, 3);
- widget_->SwapBuffers();
}
virtual void themeChanged() {
@@ -519,6 +510,21 @@ bool RenderWidgetFullscreenPepper::SupportsAsynchronousSwapBuffers() {
return context_ != NULL;
}
+// Fullscreen pepper widgets composite themselves into the plugin's backing
+// texture (as opposed to using the cc library to composite as normal
+// content::RenderWidgets do), so to produce a composited frame we just have to
+// draw this texture and swap.
+void RenderWidgetFullscreenPepper::Composite() {
+ if (!plugin_)
+ return;
+
+ DCHECK(context_);
+ unsigned int texture = plugin_->GetBackingTextureId();
+ context_->bindTexture(GL_TEXTURE_2D, texture);
+ context_->drawArrays(GL_TRIANGLES, 0, 3);
+ SwapBuffers();
+}
+
void RenderWidgetFullscreenPepper::CreateContext() {
DCHECK(!context_);
CommandLine* command_line = CommandLine::ForCurrentProcess();
« no previous file with comments | « content/renderer/render_widget_fullscreen_pepper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698