Commit fbe382a2 authored by piman@chromium.org's avatar piman@chromium.org

Don't test kEnableThreadedCompositing in WebGraphicsContext3DCommandBufferImpl

It's a layering violation (and has crazy side effects when instantiating those
in the browser).

BUG=None

Review URL: https://codereview.chromium.org/57543004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233405 0039d316-1c4b-4281-b951-d872f2087c98
parent 9c194eb9
...@@ -509,12 +509,14 @@ GpuProcessTransportFactory::CreateContextCommon( ...@@ -509,12 +509,14 @@ GpuProcessTransportFactory::CreateContextCommon(
if (!gpu_channel_host) if (!gpu_channel_host)
return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon"); GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon");
bool use_echo_for_swap_ack = true;
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
new WebGraphicsContext3DCommandBufferImpl( new WebGraphicsContext3DCommandBufferImpl(
surface_id, surface_id,
url, url,
gpu_channel_host.get(), gpu_channel_host.get(),
swap_client, swap_client,
use_echo_for_swap_ack,
attrs, attrs,
false, false,
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())); WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits()));
......
...@@ -381,11 +381,13 @@ CreateGpuProcessViewContext( ...@@ -381,11 +381,13 @@ CreateGpuProcessViewContext(
limits.max_transfer_buffer_size = std::min( limits.max_transfer_buffer_size = std::min(
3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024; limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024;
bool use_echo_for_swap_ack = true;
return make_scoped_ptr( return make_scoped_ptr(
new WebGraphicsContext3DCommandBufferImpl(surface_id, new WebGraphicsContext3DCommandBufferImpl(surface_id,
url, url,
gpu_channel_host.get(), gpu_channel_host.get(),
compositor_impl, compositor_impl,
use_echo_for_swap_ack,
attributes, attributes,
false, false,
limits)); limits));
......
...@@ -79,11 +79,13 @@ CmdBufferImageTransportFactory::CmdBufferImageTransportFactory() { ...@@ -79,11 +79,13 @@ CmdBufferImageTransportFactory::CmdBufferImageTransportFactory() {
3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
limits.mapped_memory_reclaim_limit = limits.mapped_memory_reclaim_limit =
WebGraphicsContext3DCommandBufferImpl::kNoLimit; WebGraphicsContext3DCommandBufferImpl::kNoLimit;
bool use_echo_for_swap_ack = true;
context_.reset( context_.reset(
new WebGraphicsContext3DCommandBufferImpl(0, // offscreen new WebGraphicsContext3DCommandBufferImpl(0, // offscreen
url, url,
gpu_channel_host.get(), gpu_channel_host.get(),
swap_client, swap_client,
use_echo_for_swap_ack,
attrs, attrs,
false, false,
limits)); limits));
......
...@@ -213,6 +213,7 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl( ...@@ -213,6 +213,7 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
const GURL& active_url, const GURL& active_url,
GpuChannelHost* host, GpuChannelHost* host,
const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client, const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client,
bool use_echo_for_swap_ack,
const Attributes& attributes, const Attributes& attributes,
bool bind_generates_resources, bool bind_generates_resources,
const SharedMemoryLimits& limits) const SharedMemoryLimits& limits)
...@@ -235,15 +236,9 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl( ...@@ -235,15 +236,9 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
gl_(NULL), gl_(NULL),
frame_number_(0), frame_number_(0),
bind_generates_resources_(bind_generates_resources), bind_generates_resources_(bind_generates_resources),
use_echo_for_swap_ack_(true), use_echo_for_swap_ack_(use_echo_for_swap_ack),
mem_limits_(limits), mem_limits_(limits),
flush_id_(0) { flush_id_(0) {
#if (defined(OS_MACOSX) || defined(OS_WIN)) && !defined(USE_AURA)
// Get ViewMsg_SwapBuffers_ACK from browser for single-threaded path.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
use_echo_for_swap_ack_ =
command_line.HasSwitch(switches::kEnableThreadedCompositing);
#endif
} }
WebGraphicsContext3DCommandBufferImpl:: WebGraphicsContext3DCommandBufferImpl::
...@@ -1272,10 +1267,12 @@ WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( ...@@ -1272,10 +1267,12 @@ WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
if (!host) if (!host)
return NULL; return NULL;
base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client; base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> null_client;
bool use_echo_for_swap_ack = true;
return new WebGraphicsContext3DCommandBufferImpl(0, return new WebGraphicsContext3DCommandBufferImpl(0,
active_url, active_url,
host, host,
null_client, null_client,
use_echo_for_swap_ack,
attributes, attributes,
false, false,
SharedMemoryLimits()); SharedMemoryLimits());
......
...@@ -90,6 +90,7 @@ class WebGraphicsContext3DCommandBufferImpl ...@@ -90,6 +90,7 @@ class WebGraphicsContext3DCommandBufferImpl
const GURL& active_url, const GURL& active_url,
GpuChannelHost* host, GpuChannelHost* host,
const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client, const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client,
bool use_echo_for_swap_ack,
const Attributes& attributes, const Attributes& attributes,
bool bind_generates_resources, bool bind_generates_resources,
const SharedMemoryLimits& limits); const SharedMemoryLimits& limits);
......
...@@ -2826,8 +2826,14 @@ RenderWidget::CreateGraphicsContext3D( ...@@ -2826,8 +2826,14 @@ RenderWidget::CreateGraphicsContext3D(
base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client; base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client;
if (!is_threaded_compositing_enabled_) bool use_echo_for_swap_ack = true;
if (!is_threaded_compositing_enabled_) {
swap_client = weak_ptr_factory_.GetWeakPtr(); swap_client = weak_ptr_factory_.GetWeakPtr();
#if (defined(OS_MACOSX) || defined(OS_WIN)) && !defined(USE_AURA)
// ViewMsg_SwapBuffers_ACK is used instead for single-threaded path.
use_echo_for_swap_ack = false;
#endif
}
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
new WebGraphicsContext3DCommandBufferImpl( new WebGraphicsContext3DCommandBufferImpl(
...@@ -2835,6 +2841,7 @@ RenderWidget::CreateGraphicsContext3D( ...@@ -2835,6 +2841,7 @@ RenderWidget::CreateGraphicsContext3D(
GetURLForGraphicsContext3D(), GetURLForGraphicsContext3D(),
gpu_channel_host.get(), gpu_channel_host.get(),
swap_client, swap_client,
use_echo_for_swap_ack,
attributes, attributes,
false /* bind generates resources */, false /* bind generates resources */,
limits)); limits));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment