summaryrefslogtreecommitdiffstats
path: root/ui/gfx/compositor/layer.cc
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-24 12:32:19 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-24 12:32:19 +0000
commit1cbbee3cbff09ceb17af31686108e07bf4490c95 (patch)
treed9514c34b14a8b82b64ea04459f27ca8694d6863 /ui/gfx/compositor/layer.cc
parent952e1b3390348d42d8fd76c9b439c3e35c38e0a6 (diff)
downloadchromium_src-1cbbee3cbff09ceb17af31686108e07bf4490c95.zip
chromium_src-1cbbee3cbff09ceb17af31686108e07bf4490c95.tar.gz
chromium_src-1cbbee3cbff09ceb17af31686108e07bf4490c95.tar.bz2
Allow View to have a layer whose texture is updated externally.
This will be used to display texture produced by the GPU process for the RWHVV via the browser compositor. BUG=none TEST=none Review URL: http://codereview.chromium.org/7231012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/compositor/layer.cc')
-rw-r--r--ui/gfx/compositor/layer.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
index b722c12..5779e52 100644
--- a/ui/gfx/compositor/layer.cc
+++ b/ui/gfx/compositor/layer.cc
@@ -39,6 +39,13 @@ void Layer::Remove(Layer* child) {
child->parent_ = NULL;
}
+void Layer::SetTexture(ui::Texture* texture) {
+ if (texture == NULL)
+ texture_ = compositor_->CreateTexture();
+ else
+ texture_ = texture;
+}
+
void Layer::SetBitmap(const SkBitmap& bitmap, const gfx::Point& origin) {
texture_->SetBitmap(bitmap, origin, bounds_.size());
}