summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 10:05:03 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 10:05:03 +0000
commitf6668c890b01c37a5b90433c4cf2f43f85c3050a (patch)
tree5445baacd6a82eadeab6f44104ab1bfa64721b12 /cc/trees
parent286dd793164b6cccccf6ff44c0500a71cc7dc0ea (diff)
downloadchromium_src-f6668c890b01c37a5b90433c4cf2f43f85c3050a.zip
chromium_src-f6668c890b01c37a5b90433c4cf2f43f85c3050a.tar.gz
chromium_src-f6668c890b01c37a5b90433c4cf2f43f85c3050a.tar.bz2
[cc] Don't access pixels without a lock
Fix a bug where we don't lock a nine patch layer's pixels before accessing them. BUG=296830 Review URL: https://codereview.chromium.org/24490002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host_impl.cc4
-rw-r--r--cc/trees/layer_tree_host_unittest.cc1
2 files changed, 4 insertions, 1 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 90bd247..00b8922 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2728,8 +2728,10 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
resource_provider_->best_texture_format());
ui_resource_map_[uid] = id;
+
+ AutoLockUIResourceBitmap bitmap_lock(bitmap);
resource_provider_->SetPixels(id,
- bitmap.GetPixels(),
+ bitmap_lock.GetPixels(),
gfx::Rect(bitmap.GetSize()),
gfx::Rect(bitmap.GetSize()),
gfx::Vector2d(0, 0));
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 8e43de1..6afd5cb 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1743,6 +1743,7 @@ class EvictionTestLayer : public Layer {
layer_tree_host()->contents_texture_manager());
texture_->SetDimensions(gfx::Size(10, 10), RGBA_8888);
bitmap_.setConfig(SkBitmap::kARGB_8888_Config, 10, 10);
+ bitmap_.allocPixels();
}
scoped_ptr<PrioritizedResource> texture_;