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

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

Issue 2889653002: Remove cullRect() from PaintOpBuffer. (Closed)
Patch Set: movecullrect2 rebase-once-and-for-all Created 3 years, 7 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
OLDNEW
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 "web/tests/sim/SimDisplayItemList.h" 5 #include "web/tests/sim/SimDisplayItemList.h"
6 6
7 #include "core/css/parser/CSSParser.h" 7 #include "core/css/parser/CSSParser.h"
8 #include "platform/graphics/LoggingCanvas.h" 8 #include "platform/graphics/LoggingCanvas.h"
9 #include "platform/graphics/paint/PaintRecord.h" 9 #include "platform/graphics/paint/PaintRecord.h"
10 #include "third_party/skia/include/core/SkRect.h" 10 #include "third_party/skia/include/core/SkRect.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 SimDisplayItemList::SimDisplayItemList() {} 14 SimDisplayItemList::SimDisplayItemList() {}
15 15
16 void SimDisplayItemList::AppendDrawingItem(const WebRect&, 16 void SimDisplayItemList::AppendDrawingItem(const WebRect& visual_rect,
17 sk_sp<const PaintRecord> record) { 17 sk_sp<const PaintRecord> record,
18 SkIRect bounds = record->cullRect().roundOut(); 18 const WebRect& record_bounds) {
19 SimCanvas canvas(bounds.width(), bounds.height()); 19 SimCanvas canvas(record_bounds.width, record_bounds.height);
20 record->playback(&canvas); 20 record->playback(&canvas);
21 commands_.Append(canvas.Commands().data(), canvas.Commands().size()); 21 commands_.Append(canvas.Commands().data(), canvas.Commands().size());
22 } 22 }
23 23
24 bool SimDisplayItemList::Contains(SimCanvas::CommandType type, 24 bool SimDisplayItemList::Contains(SimCanvas::CommandType type,
25 const String& color_string) const { 25 const String& color_string) const {
26 Color color = 0; 26 Color color = 0;
27 if (!color_string.IsNull()) 27 if (!color_string.IsNull())
28 CHECK(CSSParser::ParseColor(color, color_string, true)); 28 CHECK(CSSParser::ParseColor(color, color_string, true));
29 for (auto& command : commands_) { 29 for (auto& command : commands_) {
30 if (command.type == type && 30 if (command.type == type &&
31 (color_string.IsNull() || command.color == color.Rgb())) 31 (color_string.IsNull() || command.color == color.Rgb()))
32 return true; 32 return true;
33 } 33 }
34 return false; 34 return false;
35 } 35 }
36 36
37 } // namespace blink 37 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.h ('k') | third_party/WebKit/public/platform/WebDisplayItemList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698