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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 12041062: Have a common implementation of cc::OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 10 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 | « cc/thread_proxy.cc ('k') | content/browser/renderer_host/image_transport_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index a68db9b8a7015403fe2fc7c8ad3b2afed18bb208..4e80d9ba4f020cc455b9d5bb1eaa9e2f8573b204 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -41,45 +41,6 @@ static bool g_initialized = false;
static webkit_glue::WebThreadImpl* g_impl_thread = NULL;
static bool g_use_direct_gl = false;
-// Adapts a pure WebGraphicsContext3D into a cc::OutputSurface.
-class WebGraphicsContextToOutputSurfaceAdapter : public cc::OutputSurface {
- public:
- explicit WebGraphicsContextToOutputSurfaceAdapter(
- WebKit::WebGraphicsContext3D* context)
- : context3d_(context),
- client_(0) {
- }
-
- virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE {
- DCHECK(client);
- if (!context3d_->makeContextCurrent())
- return false;
- client_ = client;
- return true;
- }
-
- virtual const struct Capabilities& Capabilities() const OVERRIDE {
- return capabilities_;
- }
-
- virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE {
- return context3d_.get();
- }
-
- virtual cc::SoftwareOutputDevice* SoftwareDevice() const OVERRIDE {
- return NULL;
- }
-
- virtual void SendFrameToParentCompositor(
- cc::CompositorFrame*) OVERRIDE {
- }
-
- private:
- scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
- struct Capabilities capabilities_;
- cc::OutputSurfaceClient* client_;
-};
-
} // anonymous namespace
namespace content {
@@ -318,8 +279,8 @@ scoped_ptr<cc::OutputSurface> CompositorImpl::createOutputSurface() {
attrs,
window_,
NULL));
- return scoped_ptr<cc::OutputSurface>(
- new WebGraphicsContextToOutputSurfaceAdapter(context.release()));
+ return make_scoped_ptr(new cc::OutputSurface(
+ context.PassAs<WebKit::WebGraphicsContext3D>()));
} else {
DCHECK(window_ && surface_id_);
WebKit::WebGraphicsContext3D::Attributes attrs;
@@ -339,8 +300,8 @@ scoped_ptr<cc::OutputSurface> CompositorImpl::createOutputSurface() {
LOG(ERROR) << "Failed to create 3D context for compositor.";
return scoped_ptr<cc::OutputSurface>();
}
- return scoped_ptr<cc::OutputSurface>(
- new WebGraphicsContextToOutputSurfaceAdapter(context.release()));
+ return make_scoped_ptr(new cc::OutputSurface(
+ context.PassAs<WebKit::WebGraphicsContext3D>()));
}
}
« no previous file with comments | « cc/thread_proxy.cc ('k') | content/browser/renderer_host/image_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698