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

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

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager Created 3 years, 8 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 "platform/graphics/paint/DrawingDisplayItem.h" 5 #include "platform/graphics/paint/DrawingDisplayItem.h"
6 6
7 #include "platform/graphics/GraphicsContext.h" 7 #include "platform/graphics/GraphicsContext.h"
8 #include "platform/graphics/paint/PaintCanvas.h" 8 #include "platform/graphics/paint/PaintCanvas.h"
9 #include "public/platform/WebDisplayItemList.h" 9 #include "public/platform/WebDisplayItemList.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
11 #include "third_party/skia/include/core/SkCanvas.h" 11 #include "third_party/skia/include/core/SkCanvas.h"
12 #include "third_party/skia/include/core/SkData.h" 12 #include "third_party/skia/include/core/SkData.h"
13 #include "third_party/skia/include/core/SkPictureAnalyzer.h" 13 #include "third_party/skia/include/core/SkPictureAnalyzer.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 void DrawingDisplayItem::replay(GraphicsContext& context) const { 17 void DrawingDisplayItem::replay(GraphicsContext& context) const {
18 if (m_record) 18 if (m_record)
19 context.drawRecord(m_record.get()); 19 context.drawRecord(m_record.get());
20 else if (m_drawable)
21 context.drawDrawable(m_drawable.get());
20 } 22 }
21 23
22 void DrawingDisplayItem::appendToWebDisplayItemList( 24 void DrawingDisplayItem::appendToWebDisplayItemList(
23 const IntRect& visualRect, 25 const IntRect& visualRect,
24 WebDisplayItemList* list) const { 26 WebDisplayItemList* list) const {
25 if (m_record) 27 if (m_record)
26 list->appendDrawingItem(visualRect, m_record); 28 list->appendDrawingItem(visualRect, m_record);
27 } 29 }
28 30
29 bool DrawingDisplayItem::drawsContent() const { 31 bool DrawingDisplayItem::drawsContent() const {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 116
115 if (recordsEqual(record, otherRecord)) 117 if (recordsEqual(record, otherRecord))
116 return true; 118 return true;
117 119
118 // Sometimes the client may produce different records for the same visual 120 // Sometimes the client may produce different records for the same visual
119 // result, which should be treated as equal. 121 // result, which should be treated as equal.
120 return bitmapsEqual(record, otherRecord); 122 return bitmapsEqual(record, otherRecord);
121 } 123 }
122 124
123 } // namespace blink 125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698