summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-10 07:33:27 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-10 07:33:27 +0000
commit2541d1ac91e59dc5eb26addb44e9d9496e10f9f7 (patch)
tree307abbdb543b9d89050c2382e56c0cdee3fca383 /cc
parent43d9663e465af59f73efed267228a909d1832fc4 (diff)
downloadchromium_src-2541d1ac91e59dc5eb26addb44e9d9496e10f9f7.zip
chromium_src-2541d1ac91e59dc5eb26addb44e9d9496e10f9f7.tar.gz
chromium_src-2541d1ac91e59dc5eb26addb44e9d9496e10f9f7.tar.bz2
Allow WebExternalTextureLayers to receive a bitmap along with a mailbox
When using the software renderer, texture layers can't be drawn from directly. Instead allow the WebExternalTextureLayer to request a bitmap that will be used to draw. BUG=151713 Review URL: https://chromiumcodereview.appspot.com/17859002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/layers/texture_layer.cc3
-rw-r--r--cc/layers/texture_layer_client.h3
-rw-r--r--cc/layers/texture_layer_unittest.cc3
-rw-r--r--cc/output/software_renderer.cc1
-rw-r--r--cc/trees/layer_tree_host.cc7
-rw-r--r--cc/trees/layer_tree_host.h3
6 files changed, 16 insertions, 4 deletions
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index fad7b13..eb00e53 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -172,7 +172,8 @@ bool TextureLayer::Update(ResourceUpdateQueue* queue,
if (client_) {
if (uses_mailbox_) {
TextureMailbox mailbox;
- if (client_->PrepareTextureMailbox(&mailbox)) {
+ if (client_->PrepareTextureMailbox(
+ &mailbox, layer_tree_host()->UsingSharedMemoryResources())) {
SetTextureMailbox(mailbox);
updated = true;
}
diff --git a/cc/layers/texture_layer_client.h b/cc/layers/texture_layer_client.h
index b5c0de6..b9fc51c 100644
--- a/cc/layers/texture_layer_client.h
+++ b/cc/layers/texture_layer_client.h
@@ -25,7 +25,8 @@ class TextureLayerClient {
// Returns true and provides a mailbox if a new frame is available.
// Returns false if no new data is available
// and the old mailbox is to be reused.
- virtual bool PrepareTextureMailbox(TextureMailbox* mailbox) = 0;
+ virtual bool PrepareTextureMailbox(TextureMailbox* mailbox,
+ bool use_shared_memory) = 0;
protected:
virtual ~TextureLayerClient() {}
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index 39c0836..0f78b19 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -706,7 +706,8 @@ class TextureLayerClientTest
return context_;
}
- virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox) OVERRIDE {
+ virtual bool PrepareTextureMailbox(
+ cc::TextureMailbox* mailbox, bool use_shared_memory) OVERRIDE {
return false;
}
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc
index e7273a8..817bb67 100644
--- a/cc/output/software_renderer.cc
+++ b/cc/output/software_renderer.cc
@@ -76,6 +76,7 @@ SoftwareRenderer::SoftwareRenderer(RendererClient* client,
capabilities_.using_partial_swap = true;
capabilities_.using_map_image = Settings().use_map_image;
+ capabilities_.using_shared_memory_resources = true;
}
SoftwareRenderer::~SoftwareRenderer() {}
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index f3c262f..ff4d007 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -52,7 +52,8 @@ RendererCapabilities::RendererCapabilities()
using_offscreen_context3d(false),
max_texture_size(0),
avoid_pow2_textures(false),
- using_map_image(false) {}
+ using_map_image(false),
+ using_shared_memory_resources(false) {}
RendererCapabilities::~RendererCapabilities() {}
@@ -683,6 +684,10 @@ void LayerTreeHost::CalculateLCDTextMetricsCallback(Layer* layer) {
}
}
+bool LayerTreeHost::UsingSharedMemoryResources() {
+ return GetRendererCapabilities().using_shared_memory_resources;
+}
+
bool LayerTreeHost::UpdateLayers(Layer* root_layer,
ResourceUpdateQueue* queue) {
// If you change the name of this event or its arguments, please update
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index 3d114d5..b838aa2 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -80,6 +80,7 @@ struct CC_EXPORT RendererCapabilities {
int max_texture_size;
bool avoid_pow2_textures;
bool using_map_image;
+ bool using_shared_memory_resources;
};
class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
@@ -255,6 +256,8 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
bool in_paint_layer_contents() const { return in_paint_layer_contents_; }
+ bool UsingSharedMemoryResources();
+
protected:
LayerTreeHost(LayerTreeHostClient* client, const LayerTreeSettings& settings);
bool Initialize(scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);