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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.cpp

Issue 2791043002: Draw recorded content directly into the containing PaintCanvas, when possible. (Closed)
Patch Set: none 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/paint/PaintRecordBuilder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.cpp
index 5c24e3cd4e80ae2accc48436e7269d29531d3beb..a6d69107d6de0c9570c1f5a1920395052c39a343 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.cpp
@@ -51,13 +51,23 @@ PaintRecordBuilder::~PaintRecordBuilder() {
#endif
}
-sk_sp<PaintRecord> PaintRecordBuilder::endRecording(
- const PropertyTreeState& propertyTreeState) {
+sk_sp<PaintRecord> PaintRecordBuilder::endRecording() {
m_context->beginRecording(m_bounds);
m_paintController->commitNewDisplayItems();
- m_paintController->paintArtifact().replay(m_bounds, *m_context,
- propertyTreeState);
+ m_paintController->paintArtifact().replay(m_bounds, *m_context);
return m_context->endRecording();
}
+void PaintRecordBuilder::endRecording(
+ PaintCanvas& canvas,
+ const PropertyTreeState& propertyTreeState) {
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ canvas.drawPicture(endRecording());
+ } else {
+ m_paintController->commitNewDisplayItems();
+ m_paintController->paintArtifact().replay(m_bounds, canvas,
+ propertyTreeState);
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698