| Index: content/renderer/android/synchronous_compositor_output_surface.cc
|
| diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_output_surface.cc
|
| index 7acdf8a31b62e13e82872e3c2fdafe87a418f4b1..8d86600e8f65cf6259a1abc04b36a787310b7862 100644
|
| --- a/content/renderer/android/synchronous_compositor_output_surface.cc
|
| +++ b/content/renderer/android/synchronous_compositor_output_surface.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/time.h"
|
| #include "cc/output/compositor_frame.h"
|
| #include "cc/output/compositor_frame_ack.h"
|
| +#include "cc/output/context_provider.h"
|
| #include "cc/output/output_surface_client.h"
|
| #include "cc/output/software_output_device.h"
|
| #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
|
| @@ -32,9 +33,6 @@ namespace {
|
|
|
| // TODO(boliu): RenderThreadImpl should create in process contexts as well.
|
| scoped_ptr<WebKit::WebGraphicsContext3D> CreateWebGraphicsContext3D() {
|
| - if (!CommandLine::ForCurrentProcess()->HasSwitch("testing-webview-gl-mode"))
|
| - return scoped_ptr<WebKit::WebGraphicsContext3D>();
|
| -
|
| WebKit::WebGraphicsContext3D::Attributes attributes;
|
| attributes.antialias = false;
|
| attributes.shareResources = true;
|
| @@ -88,9 +86,8 @@ class SynchronousCompositorOutputSurface::SoftwareDevice
|
|
|
| SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
|
| int32 routing_id)
|
| - : cc::OutputSurface(CreateWebGraphicsContext3D(),
|
| - scoped_ptr<cc::SoftwareOutputDevice>(
|
| - new SoftwareDevice(this))),
|
| + : cc::OutputSurface(
|
| + scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))),
|
| compositor_client_(NULL),
|
| routing_id_(routing_id),
|
| needs_begin_frame_(false),
|
| @@ -149,10 +146,6 @@ void SynchronousCompositorOutputSurface::SetClient(
|
| UpdateCompositorClientSettings();
|
| }
|
|
|
| -bool SynchronousCompositorOutputSurface::IsHwReady() {
|
| - return context3d() != NULL;
|
| -}
|
| -
|
| bool SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) {
|
| DCHECK(CalledOnValidThread());
|
| DCHECK(canvas);
|
| @@ -177,10 +170,24 @@ bool SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) {
|
| return finished_draw;
|
| }
|
|
|
| +bool SynchronousCompositorOutputSurface::InitializeHwDraw() {
|
| + DCHECK(CalledOnValidThread());
|
| + DCHECK(client_);
|
| + DCHECK(!context3d_);
|
| +
|
| + context3d_ = CreateWebGraphicsContext3D().Pass();
|
| +
|
| + // TODO(boliu): Get a context provider in constructor and pass here.
|
| + bool result = client_->InitializeForGL(scoped_refptr<cc::ContextProvider>());
|
| + if (!result)
|
| + client_->DidLoseOutputSurface();
|
| + return result;
|
| +}
|
| +
|
| bool SynchronousCompositorOutputSurface::DemandDrawHw(
|
| - gfx::Size view_size,
|
| - const gfx::Transform& transform,
|
| - gfx::Rect damage_area) {
|
| + gfx::Size view_size,
|
| + const gfx::Transform& transform,
|
| + gfx::Rect damage_area) {
|
| DCHECK(CalledOnValidThread());
|
| DCHECK(client_);
|
|
|
|
|