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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
index e014804efc3c757d376654182ff01ea43ed06ea5..28170ef0b2d3c3df7b6eaad5558f5e919a1a015e 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
@@ -300,6 +300,17 @@ sk_sp<PaintRecord> GraphicsContext::endRecording() {
return record;
}
+sk_sp<SkDrawable> GraphicsContext::endRecordingAsDrawable() {
+ if (contextDisabled()) {
+ return nullptr;
+ }
+
+ sk_sp<SkDrawable> drawable = m_paintRecorder.finishRecordingAsDrawable();
+ m_canvas = nullptr;
+ DCHECK(drawable);
+ return drawable;
+}
+
void GraphicsContext::drawRecord(const PaintRecord* record) {
if (contextDisabled() || !record || record->cullRect().isEmpty())
return;
@@ -308,6 +319,14 @@ void GraphicsContext::drawRecord(const PaintRecord* record) {
m_canvas->drawPicture(record);
}
+void GraphicsContext::drawDrawable(const SkDrawable* drawable) {
+ if (contextDisabled() || !drawable)
+ return;
+
+ DCHECK(m_canvas);
+ m_canvas->drawDrawable((SkDrawable*)drawable, nullptr);
+}
+
void GraphicsContext::compositeRecord(sk_sp<PaintRecord> record,
const FloatRect& dest,
const FloatRect& src,

Powered by Google App Engine
This is Rietveld 408576698