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

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

Issue 2328413002: Cleanups of PaintController (Closed)
Patch Set: - Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 { 694 {
695 StringBuilder stringBuilder; 695 StringBuilder stringBuilder;
696 size_t i = 0; 696 size_t i = 0;
697 for (auto it = list.begin(); it != list.end(); ++it, ++i) { 697 for (auto it = list.begin(); it != list.end(); ++it, ++i) {
698 const DisplayItem& displayItem = *it; 698 const DisplayItem& displayItem = *it;
699 if (i) 699 if (i)
700 stringBuilder.append(",\n"); 700 stringBuilder.append(",\n");
701 stringBuilder.append(String::format("{index: %zu, ", i)); 701 stringBuilder.append(String::format("{index: %zu, ", i));
702 #ifndef NDEBUG 702 #ifndef NDEBUG
703 displayItem.dumpPropertiesAsDebugString(stringBuilder); 703 displayItem.dumpPropertiesAsDebugString(stringBuilder);
704 #endif
705
706 if (displayItem.hasValidClient()) {
707 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
708 if (!displayItem.client().isAlive()) {
709 stringBuilder.append(", clientIsAlive: false");
710 } else {
704 #else 711 #else
705 stringBuilder.append(String::format("clientDebugName: %s", displayItem.c lient().debugName().ascii().data())); 712 // debugName() and clientCacheIsValid() can only be called on alive client, so only output it for
713 // m_newDisplayItemList in which we are sure the clients are all ali ve.
714 if (&list == &m_newDisplayItemList) {
706 #endif 715 #endif
707 if (displayItem.hasValidClient()) { 716 #ifdef NDEBUG
708 do { 717 stringBuilder.append(String::format("clientDebugName: \"%s\"", d isplayItem.client().debugName().ascii().data()));
709 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
710 if (!displayItem.client().isAlive()) {
711 stringBuilder.append(", clientIsAlive: false");
712 break;
713 }
714 #endif 718 #endif
715 stringBuilder.append(", cacheIsValid: "); 719 stringBuilder.append(", cacheIsValid: ");
716 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "true" : "false"); 720 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "true" : "false");
717 } while (false); 721 }
718 #ifndef NDEBUG 722 #ifndef NDEBUG
719 if (showPictures && displayItem.isDrawing()) { 723 if (showPictures && displayItem.isDrawing()) {
720 if (const SkPicture* picture = static_cast<const DrawingDisplayI tem&>(displayItem).picture()) { 724 if (const SkPicture* picture = static_cast<const DrawingDisplayI tem&>(displayItem).picture()) {
721 stringBuilder.append(", picture: "); 725 stringBuilder.append(", picture: ");
722 stringBuilder.append(pictureAsDebugString(picture)); 726 stringBuilder.append(pictureAsDebugString(picture));
723 } 727 }
724 } 728 }
725 #endif 729 #endif
726 } 730 }
727 if (list.hasVisualRect(i)) { 731 if (list.hasVisualRect(i)) {
728 IntRect visualRect = list.visualRect(i); 732 IntRect visualRect = list.visualRect(i);
729 stringBuilder.append(String::format(", visualRect: [%d,%d %dx%d]", 733 stringBuilder.append(String::format(", visualRect: [%d,%d %dx%d]",
730 visualRect.x(), visualRect.y(), 734 visualRect.x(), visualRect.y(),
731 visualRect.width(), visualRect.height())); 735 visualRect.width(), visualRect.height()));
732 } 736 }
733 stringBuilder.append('}'); 737 stringBuilder.append('}');
734 } 738 }
735 return stringBuilder.toString(); 739 return stringBuilder.toString();
736 } 740 }
737 741
738 void PaintController::showDebugDataInternal(bool showPictures) const 742 void PaintController::showDebugDataInternal(bool showPictures) const
739 { 743 {
740 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList(), showPictures).utf8().data()); 744 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList(), showPictures).utf8().data());
741 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList, showPictures).utf8().data()); 745 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList, showPictures).utf8().data());
742 } 746 }
743 747
744 } // namespace blink 748 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698