X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Fbrowser%2Fandroid%2Fin_process%2Fsynchronous_compositor_output_surface.cc;h=40659909562a2e1c2ef678577e150792b946cfd6;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=2058fd18a1881eaed54e9f005cf554cf83211b25;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/src/content/browser/android/in_process/synchronous_compositor_output_surface.cc index 2058fd1..4065990 100644 --- a/src/content/browser/android/in_process/synchronous_compositor_output_surface.cc +++ b/src/content/browser/android/in_process/synchronous_compositor_output_surface.cc @@ -13,7 +13,6 @@ #include "cc/output/software_output_device.h" #include "content/browser/android/in_process/synchronous_compositor_impl.h" #include "content/public/browser/browser_thread.h" -#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/common/gpu_memory_allocation.h" #include "third_party/skia/include/core/SkBitmapDevice.h" @@ -21,43 +20,11 @@ #include "ui/gfx/rect_conversions.h" #include "ui/gfx/skia_util.h" #include "ui/gfx/transform.h" -#include "ui/gl/gl_surface.h" -#include "webkit/common/gpu/context_provider_in_process.h" -#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" namespace content { namespace { -scoped_ptr -CreateWebGraphicsContext3D(scoped_refptr surface) { - using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; - if (!gfx::GLSurface::InitializeOneOff()) - return scoped_ptr(); - - const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; - - blink::WebGraphicsContext3D::Attributes attributes; - attributes.antialias = false; - attributes.shareResources = true; - attributes.noAutomaticFlushes = true; - - gpu::GLInProcessContextAttribs in_process_attribs; - WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( - attributes, &in_process_attribs); - scoped_ptr context( - gpu::GLInProcessContext::CreateWithSurface(surface, - attributes.shareResources, - in_process_attribs, - gpu_preference)); - - if (!context.get()) - return scoped_ptr(); - - return WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( - context.Pass(), attributes).Pass(); -} - void DidActivatePendingTree(int routing_id) { SynchronousCompositorOutputSurfaceDelegate* delegate = SynchronousCompositorImpl::FromRoutingID(routing_id); @@ -75,7 +42,7 @@ class SynchronousCompositorOutputSurface::SoftwareDevice null_device_(SkBitmap::kARGB_8888_Config, 1, 1), null_canvas_(&null_device_) { } - virtual void Resize(gfx::Size size) OVERRIDE { + virtual void Resize(const gfx::Size& size) OVERRIDE { // Intentional no-op: canvas size is controlled by the embedder. } virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE { @@ -156,7 +123,7 @@ bool SynchronousCompositorOutputSurface::BindToClient( } void SynchronousCompositorOutputSurface::Reshape( - gfx::Size size, float scale_factor) { + const gfx::Size& size, float scale_factor) { // Intentional no-op: surface size is controlled by the embedder. } @@ -193,16 +160,12 @@ void AdjustTransform(gfx::Transform* transform, gfx::Rect viewport) { } // namespace bool SynchronousCompositorOutputSurface::InitializeHwDraw( - scoped_refptr surface, + scoped_refptr onscreen_context_provider, scoped_refptr offscreen_context_provider) { DCHECK(CalledOnValidThread()); DCHECK(HasClient()); DCHECK(!context_provider_); - DCHECK(surface); - scoped_refptr onscreen_context_provider = - webkit::gpu::ContextProviderInProcess::Create( - CreateWebGraphicsContext3D(surface), "SynchronousCompositor"); return InitializeAndSetContext3d(onscreen_context_provider, offscreen_context_provider); }