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

Side by Side Diff: Source/platform/graphics/paint/DrawingDisplayItem.cpp

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ready for review Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "platform/graphics/paint/DrawingDisplayItem.h" 6 #include "platform/graphics/paint/DrawingDisplayItem.h"
7 7
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/paint/DisplayItems.h"
9 #include "public/platform/WebDisplayItemList.h" 10 #include "public/platform/WebDisplayItemList.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 void DrawingDisplayItem::replay(GraphicsContext& context) 14 void DrawingDisplayItem::replay(GraphicsContext& context)
14 { 15 {
15 if (m_picture) 16 if (m_picture)
16 context.drawPicture(m_picture.get()); 17 context.drawPicture(m_picture.get());
17 } 18 }
18 19
19 void DrawingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) co nst 20 void DrawingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) co nst
20 { 21 {
21 if (m_picture) 22 if (m_picture)
22 list->appendDrawingItem(m_picture.get()); 23 list->appendDrawingItem(m_picture.get());
23 } 24 }
24 25
26 void DrawingDisplayItem::appendByMoving(DisplayItems& destination)
27 {
28 destination.emplaceBack<DrawingDisplayItem>(
29 DisplayItemClientWrapperHelper(*this),
30 type(), m_picture.release());
31 }
32
25 bool DrawingDisplayItem::drawsContent() const 33 bool DrawingDisplayItem::drawsContent() const
26 { 34 {
27 return m_picture; 35 return m_picture;
28 } 36 }
29 37
30 #ifndef NDEBUG 38 #ifndef NDEBUG
31 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB uilder) const 39 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB uilder) const
32 { 40 {
33 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); 41 DisplayItem::dumpPropertiesAsDebugString(stringBuilder);
34 if (m_picture) { 42 if (m_picture) {
35 stringBuilder.append(WTF::String::format(", rect: [%f,%f,%f,%f]", 43 stringBuilder.append(WTF::String::format(", rect: [%f,%f,%f,%f]",
36 m_picture->cullRect().x(), m_picture->cullRect().y(), 44 m_picture->cullRect().x(), m_picture->cullRect().y(),
37 m_picture->cullRect().width(), m_picture->cullRect().height())); 45 m_picture->cullRect().width(), m_picture->cullRect().height()));
38 } 46 }
39 } 47 }
40 #endif 48 #endif
41 49
42 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698