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

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

Issue 924533006: Don't remove empty display item pairs that draw content (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments Created 5 years, 10 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
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 "public/platform/WebDisplayItemList.h" 9 #include "public/platform/WebDisplayItemList.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 void DrawingDisplayItem::replay(GraphicsContext* context) 13 void DrawingDisplayItem::replay(GraphicsContext* context)
14 { 14 {
15 context->drawPicture(m_picture.get()); 15 context->drawPicture(m_picture.get());
16 } 16 }
17 17
18 void DrawingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) co nst 18 void DrawingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) co nst
19 { 19 {
20 list->appendDrawingItem(m_picture.get()); 20 list->appendDrawingItem(m_picture.get());
21 } 21 }
22 22
23 bool DrawingDisplayItem::drawsContent() const
24 {
25 return m_picture->approximateOpCount() > 0;
26 }
27
23 #ifndef NDEBUG 28 #ifndef NDEBUG
24 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB uilder) const 29 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB uilder) const
25 { 30 {
26 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); 31 DisplayItem::dumpPropertiesAsDebugString(stringBuilder);
27 stringBuilder.append(WTF::String::format(", rect: [%f,%f,%f,%f]", 32 stringBuilder.append(WTF::String::format(", rect: [%f,%f,%f,%f]",
28 m_picture->cullRect().x(), m_picture->cullRect().y(), 33 m_picture->cullRect().x(), m_picture->cullRect().y(),
29 m_picture->cullRect().width(), m_picture->cullRect().height())); 34 m_picture->cullRect().width(), m_picture->cullRect().height()));
30 } 35 }
31 #endif 36 #endif
32 37
33 } 38 }
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/DrawingDisplayItem.h ('k') | Source/platform/graphics/paint/FilterDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698