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

Unified Diff: content/renderer/gpu/compositor_output_surface.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 | « content/renderer/gpu/compositor_output_surface.h ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_output_surface.cc
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index da7c3c129a201bffe6d9a245589b39b2b036c74e..e3aec127ebca60629b27b3a3f0e3b7fea5157505 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -47,12 +47,11 @@ CompositorOutputSurface::CompositorOutputSurface(
int32 routing_id,
WebGraphicsContext3D* context3D,
cc::SoftwareOutputDevice* software_device)
- : output_surface_filter_(
+ : OutputSurface(make_scoped_ptr(context3D),
+ make_scoped_ptr(software_device)),
+ output_surface_filter_(
RenderThreadImpl::current()->compositor_output_surface_filter()),
- client_(NULL),
routing_id_(routing_id),
- context3D_(context3D),
- software_device_(software_device),
prefers_smoothness_(false),
main_thread_id_(base::PlatformThread::CurrentId()) {
DCHECK(output_surface_filter_);
@@ -65,26 +64,17 @@ CompositorOutputSurface::~CompositorOutputSurface() {
if (!client_)
return;
UpdateSmoothnessTakesPriority(false);
- output_surface_proxy_->ClearOutputSurface();
+ if (output_surface_proxy_)
+ output_surface_proxy_->ClearOutputSurface();
output_surface_filter_->RemoveRoute(routing_id_);
}
-const struct cc::OutputSurface::Capabilities&
- CompositorOutputSurface::Capabilities() const {
- DCHECK(CalledOnValidThread());
- return capabilities_;
-}
-
bool CompositorOutputSurface::BindToClient(
cc::OutputSurfaceClient* client) {
DCHECK(CalledOnValidThread());
- DCHECK(!client_);
- if (context3D_.get()) {
- if (!context3D_->makeContextCurrent())
- return false;
- }
- client_ = client;
+ if (!cc::OutputSurface::BindToClient(client))
+ return false;
output_surface_proxy_ = new CompositorOutputSurfaceProxy(this);
output_surface_filter_->AddRoute(
@@ -95,15 +85,6 @@ bool CompositorOutputSurface::BindToClient(
return true;
}
-WebGraphicsContext3D* CompositorOutputSurface::Context3D() const {
- DCHECK(CalledOnValidThread());
- return context3D_.get();
-}
-
-cc::SoftwareOutputDevice* CompositorOutputSurface::SoftwareDevice() const {
- return software_device_.get();
-}
-
void CompositorOutputSurface::SendFrameToParentCompositor(
cc::CompositorFrame* frame) {
DCHECK(CalledOnValidThread());
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698