summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-06-13 18:03:45 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-06-13 18:59:18 +0200
commit0c3da38c16a82a57dcf8e646210b10a8bb15915f (patch)
tree6b99d4e79d125951e4d948c681c02fbc52812e50
parent7f263ca2b600932f97845aa154aadae9abd62180 (diff)
Fix the render process crashing with impl-side-painting enabled
The error message given: Not implemented reached in virtual void cc::PictureDrawQuad::IterateResources(const ResourceIteratorCallback&) Use backported fixes that prevent PictureDrawQuads to be serialized when using the delegating renderer. Change-Id: I1ef05c2f14e0704339a5f7a6dae815b278c6c9fd Reviewed-by: Andras Becsi <andras.becsi@digia.com>
-rw-r--r--patches/chromium/0024-cc-Add-RendererCapabilitiesImpl.patch378
-rw-r--r--patches/chromium/0025-cc-Prevent-usage-of-rasterize-on-demand-with-delegat.patch389
m---------src/3rdparty0
3 files changed, 767 insertions, 0 deletions
diff --git a/patches/chromium/0024-cc-Add-RendererCapabilitiesImpl.patch b/patches/chromium/0024-cc-Add-RendererCapabilitiesImpl.patch
new file mode 100644
index 00000000..0a2661b6
--- /dev/null
+++ b/patches/chromium/0024-cc-Add-RendererCapabilitiesImpl.patch
@@ -0,0 +1,378 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "boliu@chromium.org" <boliu@chromium.org>
+Date: Wed, 15 Jan 2014 12:54:58 +0000
+Subject: cc: Add RendererCapabilitiesImpl
+
+Separate RendererCapabilities and RendererCapabilitiesImpl classes to
+separate out capabilities that are not needed on main thread to be
+not copied to main thread. This is to prepare for the future when main
+and impl RendererCapabilities copies can temporarily get out of sync,
+and there are less values to worry about.
+
+BUG=332616
+
+Review URL: https://codereview.chromium.org/133063003
+
+git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244870 0039d316-1c4b-4281-b951-d872f2087c98
+
+Conflicts:
+ cc/trees/layer_tree_impl.h
+---
+ cc/output/delegating_renderer.cc | 2 +-
+ cc/output/delegating_renderer.h | 4 ++--
+ cc/output/gl_renderer.cc | 2 +-
+ cc/output/gl_renderer.h | 4 ++--
+ cc/output/renderer.cc | 22 ++++++++++++++++++++++
+ cc/output/renderer.h | 23 ++++++++++++++++++++++-
+ cc/output/software_renderer.cc | 2 +-
+ cc/output/software_renderer.h | 4 ++--
+ cc/trees/layer_tree_host.cc | 18 ++++++++++++------
+ cc/trees/layer_tree_host.h | 12 +++++++-----
+ cc/trees/layer_tree_host_impl.cc | 3 ++-
+ cc/trees/layer_tree_host_impl.h | 4 ++--
+ cc/trees/layer_tree_impl.cc | 2 +-
+ cc/trees/layer_tree_impl.h | 3 ++-
+ cc/trees/single_thread_proxy.cc | 3 ++-
+ cc/trees/thread_proxy.cc | 3 ++-
+ 16 files changed, 83 insertions(+), 28 deletions(-)
+
+diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc
+index 1b57161..e3a725d 100644
+--- a/cc/output/delegating_renderer.cc
++++ b/cc/output/delegating_renderer.cc
+@@ -81,7 +81,7 @@ bool DelegatingRenderer::Initialize() {
+
+ DelegatingRenderer::~DelegatingRenderer() {}
+
+-const RendererCapabilities& DelegatingRenderer::Capabilities() const {
++const RendererCapabilitiesImpl& DelegatingRenderer::Capabilities() const {
+ return capabilities_;
+ }
+
+diff --git a/cc/output/delegating_renderer.h b/cc/output/delegating_renderer.h
+index c18bfa7..beed12f 100644
+--- a/cc/output/delegating_renderer.h
++++ b/cc/output/delegating_renderer.h
+@@ -24,7 +24,7 @@ class CC_EXPORT DelegatingRenderer : public Renderer {
+ ResourceProvider* resource_provider);
+ virtual ~DelegatingRenderer();
+
+- virtual const RendererCapabilities& Capabilities() const OVERRIDE;
++ virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE;
+
+ virtual bool CanReadPixels() const OVERRIDE;
+
+@@ -60,7 +60,7 @@ class CC_EXPORT DelegatingRenderer : public Renderer {
+
+ OutputSurface* output_surface_;
+ ResourceProvider* resource_provider_;
+- RendererCapabilities capabilities_;
++ RendererCapabilitiesImpl capabilities_;
+ scoped_ptr<DelegatedFrameData> delegated_frame_data_;
+ bool visible_;
+
+diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
+index f0e32f4..51ba996 100644
+--- a/cc/output/gl_renderer.cc
++++ b/cc/output/gl_renderer.cc
+@@ -223,7 +223,7 @@ GLRenderer::~GLRenderer() {
+ CleanupSharedObjects();
+ }
+
+-const RendererCapabilities& GLRenderer::Capabilities() const {
++const RendererCapabilitiesImpl& GLRenderer::Capabilities() const {
+ return capabilities_;
+ }
+
+diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h
+index cf672f0..ab95931 100644
+--- a/cc/output/gl_renderer.h
++++ b/cc/output/gl_renderer.h
+@@ -56,7 +56,7 @@ class CC_EXPORT GLRenderer : public DirectRenderer {
+
+ virtual ~GLRenderer();
+
+- virtual const RendererCapabilities& Capabilities() const OVERRIDE;
++ virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE;
+
+ blink::WebGraphicsContext3D* Context();
+
+@@ -223,7 +223,7 @@ class CC_EXPORT GLRenderer : public DirectRenderer {
+ virtual void EnsureBackbuffer() OVERRIDE;
+ void EnforceMemoryPolicy();
+
+- RendererCapabilities capabilities_;
++ RendererCapabilitiesImpl capabilities_;
+
+ unsigned offscreen_framebuffer_id_;
+
+diff --git a/cc/output/renderer.cc b/cc/output/renderer.cc
+index 2fe0ef7..488039a 100644
+--- a/cc/output/renderer.cc
++++ b/cc/output/renderer.cc
+@@ -14,4 +14,26 @@ bool Renderer::IsContextLost() {
+ return false;
+ }
+
++RendererCapabilitiesImpl::RendererCapabilitiesImpl()
++ : best_texture_format(RGBA_8888),
++ allow_partial_texture_updates(false),
++ using_offscreen_context3d(false),
++ max_texture_size(0),
++ using_shared_memory_resources(false),
++ using_partial_swap(false),
++ using_egl_image(false),
++ avoid_pow2_textures(false),
++ using_map_image(false),
++ using_discard_framebuffer(false) {}
++
++RendererCapabilitiesImpl::~RendererCapabilitiesImpl() {}
++
++RendererCapabilities RendererCapabilitiesImpl::MainThreadCapabilities() const {
++ return RendererCapabilities(best_texture_format,
++ allow_partial_texture_updates,
++ using_offscreen_context3d,
++ max_texture_size,
++ using_shared_memory_resources);
++}
++
+ } // namespace cc
+diff --git a/cc/output/renderer.h b/cc/output/renderer.h
+index 147b535..a907cee 100644
+--- a/cc/output/renderer.h
++++ b/cc/output/renderer.h
+@@ -16,6 +16,27 @@ class CompositorFrameAck;
+ class CompositorFrameMetadata;
+ class ScopedResource;
+
++struct RendererCapabilitiesImpl {
++ RendererCapabilitiesImpl();
++ ~RendererCapabilitiesImpl();
++
++ // Capabilities copied to main thread.
++ ResourceFormat best_texture_format;
++ bool allow_partial_texture_updates;
++ bool using_offscreen_context3d;
++ int max_texture_size;
++ bool using_shared_memory_resources;
++
++ // Capabilities used on compositor thread only.
++ bool using_partial_swap;
++ bool using_egl_image;
++ bool avoid_pow2_textures;
++ bool using_map_image;
++ bool using_discard_framebuffer;
++
++ RendererCapabilities MainThreadCapabilities() const;
++};
++
+ class CC_EXPORT RendererClient {
+ public:
+ virtual void SetFullRootLayerDamage() = 0;
+@@ -25,7 +46,7 @@ class CC_EXPORT Renderer {
+ public:
+ virtual ~Renderer() {}
+
+- virtual const RendererCapabilities& Capabilities() const = 0;
++ virtual const RendererCapabilitiesImpl& Capabilities() const = 0;
+
+ virtual bool CanReadPixels() const = 0;
+
+diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc
+index 421e541..596f513 100644
+--- a/cc/output/software_renderer.cc
++++ b/cc/output/software_renderer.cc
+@@ -96,7 +96,7 @@ SoftwareRenderer::SoftwareRenderer(RendererClient* client,
+
+ SoftwareRenderer::~SoftwareRenderer() {}
+
+-const RendererCapabilities& SoftwareRenderer::Capabilities() const {
++const RendererCapabilitiesImpl& SoftwareRenderer::Capabilities() const {
+ return capabilities_;
+ }
+
+diff --git a/cc/output/software_renderer.h b/cc/output/software_renderer.h
+index 18fb2a3f..aa29274 100644
+--- a/cc/output/software_renderer.h
++++ b/cc/output/software_renderer.h
+@@ -34,7 +34,7 @@ class CC_EXPORT SoftwareRenderer : public DirectRenderer {
+ ResourceProvider* resource_provider);
+
+ virtual ~SoftwareRenderer();
+- virtual const RendererCapabilities& Capabilities() const OVERRIDE;
++ virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE;
+ virtual void Finish() OVERRIDE;
+ virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE;
+ virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE;
+@@ -97,7 +97,7 @@ class CC_EXPORT SoftwareRenderer : public DirectRenderer {
+ void DrawUnsupportedQuad(const DrawingFrame* frame,
+ const DrawQuad* quad);
+
+- RendererCapabilities capabilities_;
++ RendererCapabilitiesImpl capabilities_;
+ bool visible_;
+ bool is_scissor_enabled_;
+ bool is_backbuffer_discarded_;
+diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
+index 7432197..bc0029d 100644
+--- a/cc/trees/layer_tree_host.cc
++++ b/cc/trees/layer_tree_host.cc
+@@ -47,17 +47,23 @@ static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number;
+
+ namespace cc {
+
++RendererCapabilities::RendererCapabilities(ResourceFormat best_texture_format,
++ bool allow_partial_texture_updates,
++ bool using_offscreen_context3d,
++ int max_texture_size,
++ bool using_shared_memory_resources)
++ : best_texture_format(best_texture_format),
++ allow_partial_texture_updates(allow_partial_texture_updates),
++ using_offscreen_context3d(using_offscreen_context3d),
++ max_texture_size(max_texture_size),
++ using_shared_memory_resources(using_shared_memory_resources) {}
++
+ RendererCapabilities::RendererCapabilities()
+ : best_texture_format(RGBA_8888),
+- using_partial_swap(false),
+- using_egl_image(false),
+ allow_partial_texture_updates(false),
+ using_offscreen_context3d(false),
+ max_texture_size(0),
+- avoid_pow2_textures(false),
+- using_map_image(false),
+- using_shared_memory_resources(false),
+- using_discard_framebuffer(false) {}
++ using_shared_memory_resources(false) {}
+
+ RendererCapabilities::~RendererCapabilities() {}
+
+diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
+index 8b9c1cf..3f9e345 100644
+--- a/cc/trees/layer_tree_host.h
++++ b/cc/trees/layer_tree_host.h
+@@ -64,19 +64,21 @@ struct ScrollAndScaleSet;
+ // Provides information on an Impl's rendering capabilities back to the
+ // LayerTreeHost.
+ struct CC_EXPORT RendererCapabilities {
++ RendererCapabilities(ResourceFormat best_texture_format,
++ bool allow_partial_texture_updates,
++ bool using_offscreen_context3d,
++ int max_texture_size,
++ bool using_shared_memory_resources);
++
+ RendererCapabilities();
+ ~RendererCapabilities();
+
++ // Duplicate any modification to this list to RendererCapabilitiesImpl.
+ ResourceFormat best_texture_format;
+- bool using_partial_swap;
+- bool using_egl_image;
+ bool allow_partial_texture_updates;
+ bool using_offscreen_context3d;
+ int max_texture_size;
+- bool avoid_pow2_textures;
+- bool using_map_image;
+ bool using_shared_memory_resources;
+- bool using_discard_framebuffer;
+ };
+
+ class CC_EXPORT LayerTreeHost {
+diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
+index e4d1b73..7fbb247 100644
+--- a/cc/trees/layer_tree_host_impl.cc
++++ b/cc/trees/layer_tree_host_impl.cc
+@@ -1448,7 +1448,8 @@ bool LayerTreeHostImpl::IsContextLost() {
+ return renderer_ && renderer_->IsContextLost();
+ }
+
+-const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const {
++const RendererCapabilitiesImpl&
++LayerTreeHostImpl::GetRendererCapabilities() const {
+ return renderer_->Capabilities();
+ }
+
+diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
+index 531384f..f705a66 100644
+--- a/cc/trees/layer_tree_host_impl.h
++++ b/cc/trees/layer_tree_host_impl.h
+@@ -53,7 +53,7 @@ class TextureMailboxDeleter;
+ class TopControlsManager;
+ class UIResourceBitmap;
+ class UIResourceRequest;
+-struct RendererCapabilities;
++struct RendererCapabilitiesImpl;
+
+ // LayerTreeHost->Proxy callback interface.
+ class LayerTreeHostImplClient {
+@@ -257,7 +257,7 @@ class CC_EXPORT LayerTreeHostImpl
+ bool IsContextLost();
+ TileManager* tile_manager() { return tile_manager_.get(); }
+ Renderer* renderer() { return renderer_.get(); }
+- const RendererCapabilities& GetRendererCapabilities() const;
++ const RendererCapabilitiesImpl& GetRendererCapabilities() const;
+
+ virtual bool SwapBuffers(const FrameData& frame);
+ void SetNeedsBeginImplFrame(bool enable);
+diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
+index 9f181cd..3f7b4c6 100644
+--- a/cc/trees/layer_tree_impl.cc
++++ b/cc/trees/layer_tree_impl.cc
+@@ -517,7 +517,7 @@ const LayerTreeSettings& LayerTreeImpl::settings() const {
+ return layer_tree_host_impl_->settings();
+ }
+
+-const RendererCapabilities& LayerTreeImpl::GetRendererCapabilities() const {
++const RendererCapabilitiesImpl& LayerTreeImpl::GetRendererCapabilities() const {
+ return layer_tree_host_impl_->GetRendererCapabilities();
+ }
+
+diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
+index 85a71f5c..19c53cd 100644
+--- a/cc/trees/layer_tree_impl.h
++++ b/cc/trees/layer_tree_impl.h
+@@ -14,6 +14,7 @@
+ #include "cc/base/scoped_ptr_vector.h"
+ #include "cc/base/swap_promise.h"
+ #include "cc/layers/layer_impl.h"
++#include "cc/output/renderer.h"
+ #include "cc/trees/layer_tree_host.h"
+ #include "cc/resources/ui_resource_client.h"
+
+@@ -60,7 +61,7 @@ class CC_EXPORT LayerTreeImpl {
+ // Methods called by the layer tree that pass-through or access LTHI.
+ // ---------------------------------------------------------------------------
+ const LayerTreeSettings& settings() const;
+- const RendererCapabilities& GetRendererCapabilities() const;
++ const RendererCapabilitiesImpl& GetRendererCapabilities() const;
+ ContextProvider* context_provider() const;
+ OutputSurface* output_surface() const;
+ ResourceProvider* resource_provider() const;
+diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
+index f1f8a4f..a313588 100644
+--- a/cc/trees/single_thread_proxy.cc
++++ b/cc/trees/single_thread_proxy.cc
+@@ -148,7 +148,8 @@ void SingleThreadProxy::CreateAndInitializeOutputSurface() {
+ output_surface.Pass());
+ if (initialized) {
+ renderer_capabilities_for_main_thread_ =
+- layer_tree_host_impl_->GetRendererCapabilities();
++ layer_tree_host_impl_->GetRendererCapabilities()
++ .MainThreadCapabilities();
+ } else if (offscreen_context_provider.get()) {
+ offscreen_context_provider->VerifyContexts();
+ offscreen_context_provider = NULL;
+diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
+index 2823182..62e0ca2 100644
+--- a/cc/trees/thread_proxy.cc
++++ b/cc/trees/thread_proxy.cc
+@@ -1427,7 +1427,8 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread(
+ *success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass());
+
+ if (*success) {
+- *capabilities = layer_tree_host_impl_->GetRendererCapabilities();
++ *capabilities = layer_tree_host_impl_->GetRendererCapabilities()
++ .MainThreadCapabilities();
+ scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
+ } else if (offscreen_context_provider.get()) {
+ if (offscreen_context_provider->BindToCurrentThread())
diff --git a/patches/chromium/0025-cc-Prevent-usage-of-rasterize-on-demand-with-delegat.patch b/patches/chromium/0025-cc-Prevent-usage-of-rasterize-on-demand-with-delegat.patch
new file mode 100644
index 00000000..ffcefece
--- /dev/null
+++ b/patches/chromium/0025-cc-Prevent-usage-of-rasterize-on-demand-with-delegat.patch
@@ -0,0 +1,389 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "reveman@chromium.org" <reveman@chromium.org>
+Date: Tue, 11 Feb 2014 01:56:37 +0000
+Subject: cc: Prevent usage of rasterize on-demand with delegating renderer.
+
+PictureDrawQuads are not yet supported by the delegating renderer.
+Generating this type of quads for on-demand raster of tiles cause
+invalid IPC to be sent to the parent compositor and the renderer
+to be killed.
+
+This makes us activate with low-res or checkerboard tiles until
+PictureDrawQuads are properly supported by the delegating renderer.
+
+BUG=340695
+TEST=cc_unittests --gtest_filter=*RasterizeOnDemand*
+
+Review URL: https://codereview.chromium.org/157743007
+
+git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250273 0039d316-1c4b-4281-b951-d872f2087c98
+
+Conflicts:
+ cc/resources/tile_manager.cc
+---
+ cc/output/delegating_renderer.cc | 2 ++
+ cc/output/gl_renderer.cc | 2 ++
+ cc/output/renderer.cc | 3 +-
+ cc/output/renderer.h | 1 +
+ cc/output/software_renderer.cc | 2 ++
+ cc/resources/tile_manager.cc | 15 +++++---
+ cc/resources/tile_manager.h | 6 +++-
+ cc/resources/tile_manager_unittest.cc | 57 +++++++++++++++++++++++++++----
+ cc/trees/layer_tree_host_impl.cc | 15 +++++---
+ cc/trees/layer_tree_host_impl.h | 3 +-
+ cc/trees/layer_tree_host_impl_unittest.cc | 8 +++++
+ 11 files changed, 95 insertions(+), 19 deletions(-)
+
+diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc
+index e3a725d..54989e3 100644
+--- a/cc/output/delegating_renderer.cc
++++ b/cc/output/delegating_renderer.cc
+@@ -76,6 +76,8 @@ bool DelegatingRenderer::Initialize() {
+ capabilities_.using_egl_image = caps.egl_image_external;
+ capabilities_.using_map_image = settings_->use_map_image && caps.map_image;
+
++ capabilities_.allow_rasterize_on_demand = false;
++
+ return true;
+ }
+
+diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
+index 51ba996..9e1a9f2 100644
+--- a/cc/output/gl_renderer.cc
++++ b/cc/output/gl_renderer.cc
+@@ -210,6 +210,8 @@ GLRenderer::GLRenderer(RendererClient* client,
+
+ capabilities_.using_discard_framebuffer = context_caps.discard_framebuffer;
+
++ capabilities_.allow_rasterize_on_demand = true;
++
+ InitializeSharedObjects();
+ }
+
+diff --git a/cc/output/renderer.cc b/cc/output/renderer.cc
+index 488039a..b0c4a60 100644
+--- a/cc/output/renderer.cc
++++ b/cc/output/renderer.cc
+@@ -24,7 +24,8 @@ RendererCapabilitiesImpl::RendererCapabilitiesImpl()
+ using_egl_image(false),
+ avoid_pow2_textures(false),
+ using_map_image(false),
+- using_discard_framebuffer(false) {}
++ using_discard_framebuffer(false),
++ allow_rasterize_on_demand(false) {}
+
+ RendererCapabilitiesImpl::~RendererCapabilitiesImpl() {}
+
+diff --git a/cc/output/renderer.h b/cc/output/renderer.h
+index a907cee..6e491b9 100644
+--- a/cc/output/renderer.h
++++ b/cc/output/renderer.h
+@@ -33,6 +33,7 @@ struct RendererCapabilitiesImpl {
+ bool avoid_pow2_textures;
+ bool using_map_image;
+ bool using_discard_framebuffer;
++ bool allow_rasterize_on_demand;
+
+ RendererCapabilities MainThreadCapabilities() const;
+ };
+diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc
+index 596f513..781446b 100644
+--- a/cc/output/software_renderer.cc
++++ b/cc/output/software_renderer.cc
+@@ -92,6 +92,8 @@ SoftwareRenderer::SoftwareRenderer(RendererClient* client,
+
+ capabilities_.using_map_image = settings_->use_map_image;
+ capabilities_.using_shared_memory_resources = true;
++
++ capabilities_.allow_rasterize_on_demand = true;
+ }
+
+ SoftwareRenderer::~SoftwareRenderer() {}
+diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
+index 2fbb6d1..58a6973 100644
+--- a/cc/resources/tile_manager.cc
++++ b/cc/resources/tile_manager.cc
+@@ -170,6 +170,7 @@ scoped_ptr<TileManager> TileManager::Create(
+ size_t num_raster_threads,
+ RenderingStatsInstrumentation* rendering_stats_instrumentation,
+ bool use_map_image,
++ bool use_rasterize_on_demand,
+ size_t max_transfer_buffer_usage_bytes,
+ size_t max_raster_usage_bytes,
+ GLenum map_image_texture_target) {
+@@ -187,7 +188,8 @@ scoped_ptr<TileManager> TileManager::Create(
+ max_transfer_buffer_usage_bytes),
+ num_raster_threads,
+ max_raster_usage_bytes,
+- rendering_stats_instrumentation));
++ rendering_stats_instrumentation,
++ use_rasterize_on_demand));
+ }
+
+ TileManager::TileManager(
+@@ -196,7 +198,8 @@ TileManager::TileManager(
+ scoped_ptr<RasterWorkerPool> raster_worker_pool,
+ size_t num_raster_threads,
+ size_t max_raster_usage_bytes,
+- RenderingStatsInstrumentation* rendering_stats_instrumentation)
++ RenderingStatsInstrumentation* rendering_stats_instrumentation,
++ bool use_rasterize_on_demand)
+ : client_(client),
+ resource_pool_(ResourcePool::Create(
+ resource_provider,
+@@ -214,7 +217,8 @@ TileManager::TileManager(
+ ever_exceeded_memory_budget_(false),
+ rendering_stats_instrumentation_(rendering_stats_instrumentation),
+ did_initialize_visible_tile_(false),
+- did_check_for_completed_tasks_since_last_schedule_tasks_(true) {
++ did_check_for_completed_tasks_since_last_schedule_tasks_(true),
++ use_rasterize_on_demand_(use_rasterize_on_demand) {
+ raster_worker_pool_->SetClient(this);
+ }
+
+@@ -328,7 +332,8 @@ void TileManager::DidFinishRunningTasks() {
+ // If we can't raster on demand, give up early (and don't activate).
+ if (!allow_rasterize_on_demand)
+ return;
+- tile_version.set_rasterize_on_demand();
++ if (use_rasterize_on_demand_)
++ tile_version.set_rasterize_on_demand();
+ }
+ }
+
+@@ -706,7 +711,7 @@ void TileManager::AssignGpuMemoryToTiles(
+ // This tile was already on screen and now its resources have been
+ // released. In order to prevent checkerboarding, set this tile as
+ // rasterize on demand immediately.
+- if (mts.visible_and_ready_to_draw)
++ if (mts.visible_and_ready_to_draw && use_rasterize_on_demand_)
+ tile_version.set_rasterize_on_demand();
+
+ oomed = true;
+diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
+index 78beb1b..9c7a98d 100644
+--- a/cc/resources/tile_manager.h
++++ b/cc/resources/tile_manager.h
+@@ -55,6 +55,7 @@ class CC_EXPORT TileManager : public RasterWorkerPoolClient,
+ size_t num_raster_threads,
+ RenderingStatsInstrumentation* rendering_stats_instrumentation,
+ bool use_map_image,
++ bool use_rasterize_on_demand,
+ size_t max_transfer_buffer_usage_bytes,
+ size_t max_raster_usage_bytes,
+ GLenum map_image_texture_target);
+@@ -122,7 +123,8 @@ class CC_EXPORT TileManager : public RasterWorkerPoolClient,
+ scoped_ptr<RasterWorkerPool> raster_worker_pool,
+ size_t num_raster_threads,
+ size_t max_raster_usage_bytes,
+- RenderingStatsInstrumentation* rendering_stats_instrumentation);
++ RenderingStatsInstrumentation* rendering_stats_instrumentation,
++ bool use_rasterize_on_demand);
+
+ // Methods called by Tile
+ friend class Tile;
+@@ -217,6 +219,8 @@ class CC_EXPORT TileManager : public RasterWorkerPoolClient,
+
+ std::vector<Tile*> released_tiles_;
+
++ bool use_rasterize_on_demand_;
++
+ DISALLOW_COPY_AND_ASSIGN(TileManager);
+ };
+
+diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
+index 8339bd0..224e0a6 100644
+--- a/cc/resources/tile_manager_unittest.cc
++++ b/cc/resources/tile_manager_unittest.cc
+@@ -8,27 +8,33 @@
+ #include "cc/test/fake_output_surface_client.h"
+ #include "cc/test/fake_picture_pile_impl.h"
+ #include "cc/test/fake_tile_manager.h"
+-#include "cc/test/fake_tile_manager_client.h"
+ #include "cc/test/test_tile_priorities.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+ namespace cc {
+ namespace {
+
+-class TileManagerTest : public testing::TestWithParam<bool> {
++class TileManagerTest : public testing::TestWithParam<bool>,
++ public TileManagerClient {
+ public:
+ typedef std::vector<scoped_refptr<Tile> > TileVector;
+
++ TileManagerTest()
++ : memory_limit_policy_(ALLOW_ANYTHING),
++ max_memory_tiles_(0),
++ ready_to_activate_(false) {}
++
+ void Initialize(int max_tiles,
+ TileMemoryLimitPolicy memory_limit_policy,
+- TreePriority tree_priority) {
++ TreePriority tree_priority,
++ bool allow_on_demand_raster = true) {
+ output_surface_ = FakeOutputSurface::Create3d();
+ CHECK(output_surface_->BindToClient(&output_surface_client_));
+
+ resource_provider_ =
+ ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1);
+- tile_manager_ = make_scoped_ptr(
+- new FakeTileManager(&tile_manager_client_, resource_provider_.get()));
++ tile_manager_ = make_scoped_ptr(new FakeTileManager(
++ this, resource_provider_.get(), allow_on_demand_raster));
+
+ memory_limit_policy_ = memory_limit_policy;
+ max_memory_tiles_ = max_tiles;
+@@ -73,6 +79,9 @@ class TileManagerTest : public testing::TestWithParam<bool> {
+ testing::Test::TearDown();
+ }
+
++ // TileManagerClient implementation.
++ virtual void NotifyReadyToActivate() OVERRIDE { ready_to_activate_ = true; }
++
+ TileVector CreateTilesWithSize(int count,
+ TilePriority active_priority,
+ TilePriority pending_priority,
+@@ -129,11 +138,12 @@ class TileManagerTest : public testing::TestWithParam<bool> {
+ return has_lcd_count;
+ }
+
++ bool ready_to_activate() const { return ready_to_activate_; }
++
+ protected:
+ GlobalStateThatImpactsTilePriority global_state_;
+
+ private:
+- FakeTileManagerClient tile_manager_client_;
+ LayerTreeSettings settings_;
+ scoped_ptr<FakeTileManager> tile_manager_;
+ scoped_refptr<FakePicturePileImpl> picture_pile_;
+@@ -142,6 +152,7 @@ class TileManagerTest : public testing::TestWithParam<bool> {
+ scoped_ptr<ResourceProvider> resource_provider_;
+ TileMemoryLimitPolicy memory_limit_policy_;
+ int max_memory_tiles_;
++ bool ready_to_activate_;
+ };
+
+ TEST_P(TileManagerTest, EnoughMemoryAllowAnything) {
+@@ -520,6 +531,40 @@ TEST_P(TileManagerTest, RespectMemoryLimit) {
+ EXPECT_LE(memory_allocated_bytes, global_state_.memory_limit_in_bytes);
+ }
+
++TEST_P(TileManagerTest, AllowRasterizeOnDemand) {
++ // Not enough memory to initialize tiles required for activation.
++ Initialize(0, ALLOW_ANYTHING, SAME_PRIORITY_FOR_BOTH_TREES);
++ TileVector tiles =
++ CreateTiles(2, TilePriority(), TilePriorityRequiredForActivation());
++
++ tile_manager()->AssignMemoryToTiles(global_state_);
++
++ // This should make required tiles ready to draw by marking them as
++ // required tiles for on-demand raster.
++ tile_manager()->DidFinishRunningTasksForTesting();
++
++ EXPECT_TRUE(ready_to_activate());
++ for (TileVector::iterator it = tiles.begin(); it != tiles.end(); ++it)
++ EXPECT_TRUE((*it)->IsReadyToDraw());
++}
++
++TEST_P(TileManagerTest, PreventRasterizeOnDemand) {
++ // Not enough memory to initialize tiles required for activation.
++ Initialize(0, ALLOW_ANYTHING, SAME_PRIORITY_FOR_BOTH_TREES, false);
++ TileVector tiles =
++ CreateTiles(2, TilePriority(), TilePriorityRequiredForActivation());
++
++ tile_manager()->AssignMemoryToTiles(global_state_);
++
++ // This should make required tiles ready to draw by marking them as
++ // required tiles for on-demand raster.
++ tile_manager()->DidFinishRunningTasksForTesting();
++
++ EXPECT_TRUE(ready_to_activate());
++ for (TileVector::iterator it = tiles.begin(); it != tiles.end(); ++it)
++ EXPECT_FALSE((*it)->IsReadyToDraw());
++}
++
+ // If true, the max tile limit should be applied as bytes; if false,
+ // as num_resources_limit.
+ INSTANTIATE_TEST_CASE_P(TileManagerTests,
+diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
+index 7fbb247..453ccb0 100644
+--- a/cc/trees/layer_tree_host_impl.cc
++++ b/cc/trees/layer_tree_host_impl.cc
+@@ -1716,7 +1716,8 @@ void LayerTreeHostImpl::CreateAndSetRenderer(
+ void LayerTreeHostImpl::CreateAndSetTileManager(
+ ResourceProvider* resource_provider,
+ ContextProvider* context_provider,
+- bool using_map_image) {
++ bool using_map_image,
++ bool allow_rasterize_on_demand) {
+ DCHECK(settings_.impl_side_painting);
+ DCHECK(resource_provider);
+ tile_manager_ =
+@@ -1725,6 +1726,7 @@ void LayerTreeHostImpl::CreateAndSetTileManager(
+ settings_.num_raster_threads,
+ rendering_stats_instrumentation_,
+ using_map_image,
++ allow_rasterize_on_demand,
+ GetMaxTransferBufferUsageBytes(context_provider),
+ GetMaxRasterTasksUsageBytes(context_provider),
+ GetMapImageTextureTarget(context_provider));
+@@ -1777,9 +1779,11 @@ bool LayerTreeHostImpl::InitializeRenderer(
+ return false;
+
+ if (settings_.impl_side_painting) {
+- CreateAndSetTileManager(resource_provider.get(),
+- output_surface->context_provider().get(),
+- GetRendererCapabilities().using_map_image);
++ CreateAndSetTileManager(
++ resource_provider.get(),
++ output_surface->context_provider().get(),
++ GetRendererCapabilities().using_map_image,
++ GetRendererCapabilities().allow_rasterize_on_demand);
+ }
+
+ // Setup BeginImplFrameEmulation if it's not supported natively
+@@ -1884,7 +1888,8 @@ void LayerTreeHostImpl::ReleaseGL() {
+ EnforceZeroBudget(true);
+ CreateAndSetTileManager(resource_provider_.get(),
+ NULL,
+- GetRendererCapabilities().using_map_image);
++ GetRendererCapabilities().using_map_image,
++ GetRendererCapabilities().allow_rasterize_on_demand);
+ DCHECK(tile_manager_);
+
+ SetOffscreenContextProvider(NULL);
+diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
+index f705a66..e7ea10b 100644
+--- a/cc/trees/layer_tree_host_impl.h
++++ b/cc/trees/layer_tree_host_impl.h
+@@ -459,7 +459,8 @@ class CC_EXPORT LayerTreeHostImpl
+ bool skip_gl_renderer);
+ void CreateAndSetTileManager(ResourceProvider* resource_provider,
+ ContextProvider* context_provider,
+- bool using_map_image);
++ bool using_map_image,
++ bool allow_rasterize_on_demand);
+ void ReleaseTreeResources();
+ void EnforceZeroBudget(bool zero_budget);
+
+diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
+index 4630adc..cf45bfd 100644
+--- a/cc/trees/layer_tree_host_impl_unittest.cc
++++ b/cc/trees/layer_tree_host_impl_unittest.cc
+@@ -4032,6 +4032,14 @@ TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, FrameIncludesDamageRect) {
+ DrawFrameAndTestDamage(no_damage);
+ }
+
++// TODO(reveman): Remove this test and the ability to prevent on demand raster
++// when delegating renderer supports PictureDrawQuads. crbug.com/342121
++TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, PreventRasterizeOnDemand) {
++ LayerTreeSettings settings;
++ CreateHostImpl(settings, CreateOutputSurface());
++ EXPECT_FALSE(host_impl_->GetRendererCapabilities().allow_rasterize_on_demand);
++}
++
+ class FakeMaskLayerImpl : public LayerImpl {
+ public:
+ static scoped_ptr<FakeMaskLayerImpl> Create(LayerTreeImpl* tree_impl,
diff --git a/src/3rdparty b/src/3rdparty
-Subproject a6dd70e0328d155d5df8d6df48afbab690b08fb
+Subproject 66ec79d38fe3a0958ace8c131df64c1c9e0dc3e