Switch Blink to using new Skia SkCanvas::drawPicture method

As of Skia 9b14f26d (Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) - https://codereview.chromium.org/313613004) SkCanvas::drawPicture has an alternate signature. The old entry point is deprecated.

Note: this patch cannot be landed until the corresponding Skia change is rolled into Chromium & Blink.

Review URL: https://codereview.chromium.org/316863003

git-svn-id: svn://svn.chromium.org/blink/trunk@175569 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 711a5d9b
......@@ -162,7 +162,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPicture)
RefPtr<SkPicture> picture = adoptRef(recorder.endRecording());
EXPECT_EQ(0, m_frameBufferRequestCount);
m_canvas->drawPicture(*picture);
m_canvas->drawPicture(picture.get());
EXPECT_EQ(0, m_frameBufferRequestCount);
SkBitmap canvasBitmap;
......@@ -183,7 +183,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPictureProgressive)
SkCanvas* tempCanvas = recorder.beginRecording(100, 100, 0, 0);
tempCanvas->drawBitmap(image->bitmap(), 0, 0);
RefPtr<SkPicture> picture = adoptRef(recorder.endRecording());
m_canvas->drawPicture(*picture);
m_canvas->drawPicture(picture.get());
// Fully received the file and draw the SkPicture again.
m_lazyDecoder->setData(*m_data, true);
......@@ -191,7 +191,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPictureProgressive)
tempCanvas = recorder.beginRecording(100, 100, 0, 0);
tempCanvas->drawBitmap(image->bitmap(), 0, 0);
picture = adoptRef(recorder.endRecording());
m_canvas->drawPicture(*picture);
m_canvas->drawPicture(picture.get());
SkBitmap canvasBitmap;
ASSERT_TRUE(canvasBitmap.allocN32Pixels(100, 100));
......@@ -202,7 +202,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPictureProgressive)
static void rasterizeMain(SkCanvas* canvas, SkPicture* picture)
{
canvas->drawPicture(*picture);
canvas->drawPicture(picture);
}
TEST_F(DeferredImageDecoderTest, decodeOnOtherThread)
......@@ -325,7 +325,7 @@ TEST_F(DeferredImageDecoderTest, decodedSize)
tempCanvas->drawBitmap(image->bitmap(), 0, 0);
RefPtr<SkPicture> picture = adoptRef(recorder.endRecording());
EXPECT_EQ(0, m_frameBufferRequestCount);
m_canvas->drawPicture(*picture);
m_canvas->drawPicture(picture.get());
EXPECT_EQ(1, m_frameBufferRequestCount);
}
......
......@@ -543,7 +543,7 @@ void GraphicsContext::drawDisplayList(DisplayList* displayList)
if (bounds.x() || bounds.y())
m_canvas->translate(bounds.x(), bounds.y());
m_canvas->drawPicture(*displayList->picture());
m_canvas->drawPicture(displayList->picture());
if (bounds.x() || bounds.y())
m_canvas->translate(-bounds.x(), -bounds.y());
......
......@@ -202,11 +202,6 @@ public:
params->setObject("paint", objectForSkPaint(paint));
}
void drawPicture(SkPicture& picture) OVERRIDE
{
addItemWithParams("drawPicture")->setObject("picture", objectForSkPicture(picture));
}
void drawRect(const SkRect& rect, const SkPaint& paint) OVERRIDE
{
RefPtr<JSONObject> params = addItemWithParams("drawRect");
......@@ -397,6 +392,11 @@ public:
params->setString("op", regionOpName(op));
}
void onDrawPicture(const SkPicture* picture) OVERRIDE
{
addItemWithParams("drawPicture")->setObject("picture", objectForSkPicture(*picture));
}
void didSetMatrix(const SkMatrix& matrix) OVERRIDE
{
RefPtr<JSONObject> params = addItemWithParams("setMatrix");
......
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