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

Unified Diff: content/browser/renderer_host/image_transport_factory.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
Index: content/browser/renderer_host/image_transport_factory.cc
diff --git a/content/browser/renderer_host/image_transport_factory.cc b/content/browser/renderer_host/image_transport_factory.cc
index 908a091d18e89de81e1b8a401534e2590c7b65f1..94103d7c5b3675b352aca3eb4b515f61cb2fbd57 100644
--- a/content/browser/renderer_host/image_transport_factory.cc
+++ b/content/browser/renderer_host/image_transport_factory.cc
@@ -296,9 +296,8 @@ class BrowserCompositorOutputSurface
WebGraphicsContext3DCommandBufferImpl* context,
int surface_id,
BrowserCompositorOutputSurfaceProxy* output_surface_proxy)
- : context3D_(context),
+ : OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D>(context)),
surface_id_(surface_id),
- client_(NULL),
output_surface_proxy_(output_surface_proxy) {
DetachFromThread();
}
@@ -313,37 +312,14 @@ class BrowserCompositorOutputSurface
virtual bool BindToClient(
cc::OutputSurfaceClient* client) OVERRIDE {
DCHECK(CalledOnValidThread());
- DCHECK(client);
- DCHECK(!client_);
- if (context3D_.get()) {
- if (!context3D_->makeContextCurrent())
- return false;
- }
- client_ = client;
+ if (!OutputSurface::BindToClient(client))
+ return false;
+
output_surface_proxy_->AddSurface(this, surface_id_);
return true;
}
- virtual const struct Capabilities& Capabilities() const OVERRIDE {
- DCHECK(CalledOnValidThread());
- return capabilities_;
- }
-
- virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE {
- DCHECK(CalledOnValidThread());
- return context3D_.get();
- }
-
- virtual cc::SoftwareOutputDevice* SoftwareDevice() const OVERRIDE {
- DCHECK(CalledOnValidThread());
- return NULL;
- }
-
- virtual void SendFrameToParentCompositor(
- cc::CompositorFrame*) OVERRIDE {
- }
-
void OnUpdateVSyncParameters(
base::TimeTicks timebase, base::TimeDelta interval) {
DCHECK(CalledOnValidThread());
@@ -352,10 +328,7 @@ class BrowserCompositorOutputSurface
}
private:
- scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3D_;
int surface_id_;
- struct Capabilities capabilities_;
- cc::OutputSurfaceClient* client_;
scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_;
};
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/renderer/gpu/compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698