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

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

Issue 2675773003: Optimize CompositingRecorder::endCompositing to not need an SkPictureBuilder (Closed)
Patch Set: rebase Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp
index f6497aa8f7e613b4e63dd03680d08129d4104684..7952dad1b7c85f4673c35b711053571eeb5dec52 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp
@@ -9,7 +9,6 @@
#include "platform/graphics/paint/CompositingDisplayItem.h"
#include "platform/graphics/paint/DrawingRecorder.h"
#include "platform/graphics/paint/PaintController.h"
-#include "platform/graphics/paint/SkPictureBuilder.h"
namespace blink {
@@ -60,40 +59,29 @@ void CompositingRecorder::endCompositing(GraphicsContext& graphicsContext,
const DisplayItemClient& displayItemClient = lastDisplayItem->client();
DisplayItem::Type displayItemType = lastDisplayItem->getType();
- // Re-record the last two DisplayItems into a new PaintRecord.
- SkPictureBuilder pictureBuilder(cullRect, nullptr, &graphicsContext);
+ // Re-record the last two DisplayItems into a new drawing. The new item
+ // cannot be cached, because it is a mutation of the DisplayItem the client
+ // thought it was painting.
+ paintController.beginSkippingCache();
{
#if DCHECK_IS_ON()
- // The picture builder creates an internal paint controller that has been
- // initialized with null paint properties. Painting into this controller
- // without properties will not cause problems because the display item
- // from this internal paint controller is immediately reunited with the
- // correct properties.
- DisableNullPaintPropertyChecks disabler;
+ // In the recorder's scope we remove the last two display items which
+ // are combined into a new drawing.
+ DisableListModificationCheck disabler;
#endif
- DrawingRecorder newRecorder(pictureBuilder.context(), displayItemClient,
+ DrawingRecorder newRecorder(graphicsContext, displayItemClient,
displayItemType, cullRect);
DCHECK(!DrawingRecorder::useCachedDrawingIfPossible(
- pictureBuilder.context(), displayItemClient, displayItemType));
-
- secondToLastDisplayItem->replay(pictureBuilder.context());
- lastDisplayItem->replay(pictureBuilder.context());
- EndCompositingDisplayItem(client).replay(pictureBuilder.context());
- }
+ graphicsContext, displayItemClient, displayItemType));
- paintController.removeLastDisplayItem(); // Remove the DrawingDisplayItem.
- paintController
- .removeLastDisplayItem(); // Remove the BeginCompositingDisplayItem.
+ secondToLastDisplayItem->replay(graphicsContext);
+ lastDisplayItem->replay(graphicsContext);
+ EndCompositingDisplayItem(client).replay(graphicsContext);
- // The new item cannot be cached, because it is a mutation of the
- // DisplayItem the client thought it was painting.
- paintController.beginSkippingCache();
- {
- // Replay the new SKPicture into a new DrawingDisplayItem in the original
- // DisplayItemList.
- DrawingRecorder newRecorder(graphicsContext, displayItemClient,
- displayItemType, cullRect);
- pictureBuilder.endRecording()->playback(graphicsContext.canvas());
+ // Remove the DrawingDisplayItem.
+ paintController.removeLastDisplayItem();
+ // Remove the BeginCompositingDisplayItem.
+ paintController.removeLastDisplayItem();
}
paintController.endSkippingCache();
} else {
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698