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

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

Issue 794323004: Emit dummy display item when recorded picture is empty (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a missed "override" Created 6 years 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/DrawingRecorder.h" 6 #include "platform/graphics/paint/DrawingRecorder.h"
7 7
8 #include "platform/RuntimeEnabledFeatures.h" 8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/graphics/GraphicsContext.h" 9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/GraphicsLayer.h" 10 #include "platform/graphics/GraphicsLayer.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 if (m_canUseCachedDrawing) { 58 if (m_canUseCachedDrawing) {
59 #if ENABLE(ASSERT) 59 #if ENABLE(ASSERT)
60 RefPtr<const SkPicture> picture = m_context->endRecording(); 60 RefPtr<const SkPicture> picture = m_context->endRecording();
61 ASSERT(!picture || !picture->approximateOpCount()); 61 ASSERT(!picture || !picture->approximateOpCount());
62 #endif 62 #endif
63 displayItem = CachedDisplayItem::create(m_displayItemClient, m_displayIt emType); 63 displayItem = CachedDisplayItem::create(m_displayItemClient, m_displayIt emType);
64 } else { 64 } else {
65 RefPtr<const SkPicture> picture = m_context->endRecording(); 65 RefPtr<const SkPicture> picture = m_context->endRecording();
66 if (!picture || !picture->approximateOpCount()) 66 if (!picture || !picture->approximateOpCount())
67 return; 67 displayItem = DisplayItem::createDummy(m_displayItemClient, m_displa yItemType);
68 displayItem = DrawingDisplayItem::create(m_displayItemClient, m_displayI temType, picture); 68 else
69 displayItem = DrawingDisplayItem::create(m_displayItemClient, m_disp layItemType, picture);
69 } 70 }
70 71
71 #ifndef NDEBUG 72 #ifndef NDEBUG
72 displayItem->setClientDebugString(m_clientDebugString); 73 displayItem->setClientDebugString(m_clientDebugString);
73 #endif 74 #endif
74 75
75 m_context->displayItemList()->add(displayItem.release()); 76 m_context->displayItemList()->add(displayItem.release());
76 } 77 }
77 78
78 #ifndef NDEBUG 79 #ifndef NDEBUG
79 void DrawingRecorder::setClientDebugString(const WTF::String& clientDebugString) 80 void DrawingRecorder::setClientDebugString(const WTF::String& clientDebugString)
80 { 81 {
81 m_clientDebugString = clientDebugString; 82 m_clientDebugString = clientDebugString;
82 } 83 }
83 #endif 84 #endif
84 85
85 } // namespace blink 86 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698