Chromium Code Reviews| Index: Source/web/tests/sim/SimDisplayItemList.cpp |
| diff --git a/Source/web/tests/sim/SimDisplayItemList.cpp b/Source/web/tests/sim/SimDisplayItemList.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4a403e88b8934ec3c3fdd97bee1efe772734af07 |
| --- /dev/null |
| +++ b/Source/web/tests/sim/SimDisplayItemList.cpp |
| @@ -0,0 +1,28 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "config.h" |
| +#include "web/tests/sim/SimDisplayItemList.h" |
| + |
| +#include "third_party/skia/include/core/SkPicture.h" |
| + |
| +namespace blink { |
| + |
| +SimDisplayItemList::SimDisplayItemList() |
| + : m_didDrawText(false) |
| + , m_drawCount(0) |
| +{ |
| +} |
| + |
| +void SimDisplayItemList::appendDrawingItem(const SkPicture* picture) |
| +{ |
| + // There's not much we can tell about a picture, but we can tell if it |
|
jbroman
2015/09/06 17:00:51
It's possible to play a picture back to a mock SkC
esprehn
2015/09/06 20:27:58
Using gtest mocks? The SkCanvas isn't virtual. Do
esprehn
2015/09/06 21:17:56
Oh I see all the onDraw* virtual methods that the
jbroman
2015/09/07 00:52:37
Yeah. Here's a simple example of this in a test (t
|
| + // contains text. Ideally paint slimming would have a higher level |
| + // display list (or special GraphicsContext) so unit tests could query |
| + // what kind of things were painted. |
| + m_didDrawText |= picture->hasText(); |
| + m_drawCount += picture->approximateOpCount(); |
| +} |
| + |
| +} // namespace blink |