OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "web/tests/sim/SimDisplayItemList.h" | 6 #include "web/tests/sim/SimDisplayItemList.h" |
7 | 7 |
8 #include "core/css/parser/CSSParser.h" | 8 #include "core/css/parser/CSSParser.h" |
9 #include "platform/graphics/LoggingCanvas.h" | 9 #include "platform/graphics/LoggingCanvas.h" |
10 #include "third_party/skia/include/core/SkPicture.h" | 10 #include "third_party/skia/include/core/SkPicture.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 m_containsText |= picture->hasText(); | 22 m_containsText |= picture->hasText(); |
23 | 23 |
24 SkIRect bounds = picture->cullRect().roundOut(); | 24 SkIRect bounds = picture->cullRect().roundOut(); |
25 SimCanvas canvas(bounds.width(), bounds.height()); | 25 SimCanvas canvas(bounds.width(), bounds.height()); |
26 picture->playback(&canvas); | 26 picture->playback(&canvas); |
27 m_commands.append(canvas.commands().data(), canvas.commands().size()); | 27 m_commands.append(canvas.commands().data(), canvas.commands().size()); |
28 } | 28 } |
29 | 29 |
30 bool SimDisplayItemList::contains(SimCanvas::CommandType type, const String& col
orString) const | 30 bool SimDisplayItemList::contains(SimCanvas::CommandType type, const String& col
orString) const |
31 { | 31 { |
32 RGBA32 color = 0; | 32 Color color = 0; |
33 if (!colorString.isNull()) | 33 if (!colorString.isNull()) |
34 RELEASE_ASSERT(CSSParser::parseColor(color, colorString, true)); | 34 RELEASE_ASSERT(CSSParser::parseColor(color, colorString, true)); |
35 for (auto& command : m_commands) { | 35 for (auto& command : m_commands) { |
36 if (command.type == type && (colorString.isNull() || command.color == co
lor)) | 36 if (command.type == type && (colorString.isNull() || command.color == co
lor.rgb())) |
37 return true; | 37 return true; |
38 } | 38 } |
39 return false; | 39 return false; |
40 } | 40 } |
41 | 41 |
42 } // namespace blink | 42 } // namespace blink |
OLD | NEW |