Commit ea969cd0 authored by reveman@chromium.org's avatar reveman@chromium.org

Call SkBitmap::lockPixels() prior to SkPicture::getPixels() to ensure that...

Call SkBitmap::lockPixels() prior to SkPicture::getPixels() to ensure that correct pointer is returned.

BUG=111587
TEST=content_unittests --gtest_filter=RenderWidgetHostTest.Background


Review URL: http://codereview.chromium.org/9835004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128254 0039d316-1c4b-4281-b951-d872f2087c98
parent db32d906
......@@ -467,9 +467,13 @@ TEST_F(RenderWidgetHostTest, Background) {
EXPECT_EQ(4, view->GetBackground().width());
EXPECT_EQ(4, view->GetBackground().height());
EXPECT_EQ(background.getSize(), view->GetBackground().getSize());
background.lockPixels();
view->GetBackground().lockPixels();
EXPECT_TRUE(0 == memcmp(background.getPixels(),
view->GetBackground().getPixels(),
background.getSize()));
view->GetBackground().unlockPixels();
background.unlockPixels();
const IPC::Message* set_background =
process_->sink().GetUniqueMessageMatching(ViewMsg_SetBackground::ID);
......@@ -477,9 +481,13 @@ TEST_F(RenderWidgetHostTest, Background) {
Tuple1<SkBitmap> sent_background;
ViewMsg_SetBackground::Read(set_background, &sent_background);
EXPECT_EQ(background.getSize(), sent_background.a.getSize());
background.lockPixels();
sent_background.a.lockPixels();
EXPECT_TRUE(0 == memcmp(background.getPixels(),
sent_background.a.getPixels(),
background.getSize()));
sent_background.a.unlockPixels();
background.unlockPixels();
#if defined(OS_LINUX) || defined(USE_AURA)
// See the comment above |InitAsChild(NULL)|.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment