diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-09 22:37:28 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-09 22:37:28 +0000 |
commit | 039fa8c89dba9061a69a43107ca4016b255a7d39 (patch) | |
tree | 5a228350d7dc3ff9a6510df95691d37f7918d3ec /cc/test/fake_content_layer.cc | |
parent | 3e83618c9c1254dc0a76929dcc98a44cb1ba809b (diff) | |
download | chromium_src-039fa8c89dba9061a69a43107ca4016b255a7d39.zip chromium_src-039fa8c89dba9061a69a43107ca4016b255a7d39.tar.gz chromium_src-039fa8c89dba9061a69a43107ca4016b255a7d39.tar.bz2 |
Fix transition from hardware to software compositing.
When the the LayerTreeHost's output surface changes, the capabilities of
the renderer change. In particular, support for BGRA textures goes away
when transitioning from hardware compositing to software compositing.
The preferred texture format is cached by tiled layer types and isn't
updated when the renderer's capabilities change, resulting in BGRA
textures being requested for the new renderer that doesn't support them.
Add a callback to all layers on output surface creation so they can
update any cached values that they have.
Also fix a bug where LayerTreeHostImpl::resource_provider_ was assumed
to exist when getting a callback from the GPU memory manager, when in
it may have already been destroyed.
BUG=304384
NOTRY=true
Review URL: https://codereview.chromium.org/26323002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227824 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_content_layer.cc')
-rw-r--r-- | cc/test/fake_content_layer.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cc/test/fake_content_layer.cc b/cc/test/fake_content_layer.cc index 077831fd..56a52cc 100644 --- a/cc/test/fake_content_layer.cc +++ b/cc/test/fake_content_layer.cc @@ -13,6 +13,7 @@ FakeContentLayer::FakeContentLayer(ContentLayerClient* client) : ContentLayer(client), update_count_(0), push_properties_count_(0), + output_surface_created_count_(0), always_update_resources_(false) { SetAnchorPoint(gfx::PointF(0.f, 0.f)); SetBounds(gfx::Size(1, 1)); @@ -38,6 +39,11 @@ void FakeContentLayer::PushPropertiesTo(LayerImpl* layer) { push_properties_count_++; } +void FakeContentLayer::OnOutputSurfaceCreated() { + ContentLayer::OnOutputSurfaceCreated(); + output_surface_created_count_++; +} + bool FakeContentLayer::HaveBackingAt(int i, int j) { const PrioritizedResource* resource = ResourceAtForTesting(i, j); return resource && resource->have_backing_texture(); |