Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: Source/web/tests/sim/SimDisplayItemList.cpp

Issue 1329553004: Add a FOUC painting test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/sim/SimDisplayItemList.h ('k') | Source/web/tests/sim/SimLayerTreeView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "web/tests/sim/SimDisplayItemList.h"
7
8 #include "core/css/parser/CSSParser.h"
9 #include "platform/graphics/LoggingCanvas.h"
10 #include "third_party/skia/include/core/SkPicture.h"
11 #include "third_party/skia/include/core/SkRect.h"
12
13 namespace blink {
14
15 SimDisplayItemList::SimDisplayItemList()
16 : m_containsText(false)
17 {
18 }
19
20 void SimDisplayItemList::appendDrawingItem(const SkPicture* picture)
21 {
22 m_containsText |= picture->hasText();
23
24 SkIRect bounds = picture->cullRect().roundOut();
25 SimCanvas canvas(bounds.width(), bounds.height());
26 picture->playback(&canvas);
27 m_commands.append(canvas.commands().data(), canvas.commands().size());
28 }
29
30 bool SimDisplayItemList::contains(SimCanvas::CommandType type, const String& col orString) const
31 {
32 RGBA32 color = 0;
33 if (!colorString.isNull())
34 RELEASE_ASSERT(CSSParser::parseColor(color, colorString, true));
35 for (auto& command : m_commands) {
36 if (command.type == type && (colorString.isNull() || command.color == co lor))
37 return true;
38 }
39 return false;
40 }
41
42 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/tests/sim/SimDisplayItemList.h ('k') | Source/web/tests/sim/SimLayerTreeView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698