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

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

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: Fix win build 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
index ebd50c5e7910d325ed1db68c9448b3eb8109c6c8..b55b5e3467b378bc6eade222a0eccfba5035d587 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -16,6 +16,8 @@
#include <stdio.h>
#endif
+static constexpr int maxNumberOfSlowPathsBeforeVeto = 5;
+
namespace blink {
void PaintController::setTracksRasterInvalidations(bool value) {
@@ -503,15 +505,15 @@ void PaintController::commitNewDisplayItems(
!m_newDisplayItemList.isEmpty())
generateChunkRasterInvalidationRects(m_newPaintChunks.lastChunk());
- SkPictureGpuAnalyzer gpuAnalyzer;
+ int numSlowPaths = 0;
m_currentCacheGeneration =
DisplayItemClient::CacheGenerationOrInvalidationReason::next();
Vector<const DisplayItemClient*> skippedCacheClients;
for (const auto& item : m_newDisplayItemList) {
// No reason to continue the analysis once we have a veto.
- if (gpuAnalyzer.suitableForGpuRasterization())
- item.analyzeForGpuRasterization(gpuAnalyzer);
+ if (numSlowPaths <= maxNumberOfSlowPathsBeforeVeto)
+ numSlowPaths += item.numberOfSlowPaths();
// TODO(wkorman): Only compute and append visual rect for drawings.
m_newDisplayItemList.appendVisualRect(
@@ -549,7 +551,7 @@ void PaintController::commitNewDisplayItems(
m_newDisplayItemList.shrinkToFit();
m_currentPaintArtifact = PaintArtifact(
std::move(m_newDisplayItemList), m_newPaintChunks.releasePaintChunks(),
- gpuAnalyzer.suitableForGpuRasterization());
+ numSlowPaths <= maxNumberOfSlowPathsBeforeVeto);
resetCurrentListIndices();
m_outOfOrderItemIndices.clear();
m_outOfOrderChunkIndices.clear();

Powered by Google App Engine
This is Rietveld 408576698