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

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

Issue 2219523004: CL for perf tryjob on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/PaintController.h" 5 #include "platform/graphics/paint/PaintController.h"
6 6
7 #include "platform/TraceEvent.h" 7 #include "platform/TraceEvent.h"
8 #include "platform/graphics/GraphicsLayer.h" 8 #include "platform/graphics/GraphicsLayer.h"
9 #include "platform/graphics/paint/DrawingDisplayItem.h" 9 #include "platform/graphics/paint/DrawingDisplayItem.h"
10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 for (const auto& item : m_newDisplayItemList) { 437 for (const auto& item : m_newDisplayItemList) {
438 // No reason to continue the analysis once we have a veto. 438 // No reason to continue the analysis once we have a veto.
439 if (gpuAnalyzer.suitableForGpuRasterization()) 439 if (gpuAnalyzer.suitableForGpuRasterization())
440 item.analyzeForGpuRasterization(gpuAnalyzer); 440 item.analyzeForGpuRasterization(gpuAnalyzer);
441 441
442 m_newDisplayItemList.appendVisualRect(visualRectForDisplayItem(item, off setFromLayoutObject)); 442 m_newDisplayItemList.appendVisualRect(visualRectForDisplayItem(item, off setFromLayoutObject));
443 443
444 if (item.isCacheable()) { 444 if (item.isCacheable()) {
445 item.client().setDisplayItemsCached(m_currentCacheGeneration); 445 item.client().setDisplayItemsCached(m_currentCacheGeneration);
446 } else { 446 } else {
447 if (item.client().isJustCreated()) 447 //if (item.client().isJustCreated())
448 item.client().clearIsJustCreated(); 448 // item.client().clearIsJustCreated();
449 if (item.skippedCache()) 449 if (item.skippedCache())
450 skippedCacheClients.append(&item.client()); 450 skippedCacheClients.append(&item.client());
451 } 451 }
452 } 452 }
453 453
454 for (auto* client : skippedCacheClients) 454 for (auto* client : skippedCacheClients)
455 client->setDisplayItemsUncached(); 455 client->setDisplayItemsUncached();
456 456
457 // The new list will not be appended to again so we can release unused memor y. 457 // The new list will not be appended to again so we can release unused memor y.
458 m_newDisplayItemList.shrinkToFit(); 458 m_newDisplayItemList.shrinkToFit();
459 m_currentPaintArtifact = PaintArtifact(std::move(m_newDisplayItemList), m_ne wPaintChunks.releasePaintChunks(), gpuAnalyzer.suitableForGpuRasterization()); 459 m_currentPaintArtifact = PaintArtifact(std::move(m_newDisplayItemList), m_ne wPaintChunks.releasePaintChunks(), gpuAnalyzer.suitableForGpuRasterization());
460 resetCurrentListIndices(); 460 resetCurrentListIndices();
461 m_outOfOrderItemIndices.clear(); 461 m_outOfOrderItemIndices.clear();
462 462
463 /*
463 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 464 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
464 for (const auto& chunk : m_currentPaintArtifact.paintChunks()) { 465 for (const auto& chunk : m_currentPaintArtifact.paintChunks()) {
465 if (chunk.id && chunk.id->client.isJustCreated()) 466 if (chunk.id && chunk.id->client.isJustCreated())
466 chunk.id->client.clearIsJustCreated(); 467 chunk.id->client.clearIsJustCreated();
467 } 468 }
468 } 469 }
470 */
469 471
470 // We'll allocate the initial buffer when we start the next paint. 472 // We'll allocate the initial buffer when we start the next paint.
471 m_newDisplayItemList = DisplayItemList(0); 473 m_newDisplayItemList = DisplayItemList(0);
472 474
473 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 475 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
474 CHECK(m_currentSubsequenceClients.isEmpty()); 476 CHECK(m_currentSubsequenceClients.isEmpty());
475 DisplayItemClient::endShouldKeepAliveAllClients(this); 477 DisplayItemClient::endShouldKeepAliveAllClients(this);
476 #endif 478 #endif
477 479
478 #if DCHECK_IS_ON() 480 #if DCHECK_IS_ON()
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 611
610 void PaintController::showDebugData() const 612 void PaintController::showDebugData() const
611 { 613 {
612 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); 614 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data());
613 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); 615 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data());
614 } 616 }
615 617
616 #endif // ifndef NDEBUG 618 #endif // ifndef NDEBUG
617 619
618 } // namespace blink 620 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698