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

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

Issue 2118613002: Add debugging output for visual rects in PaintController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 5 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 } 485 }
486 #endif // NDEBUG 486 #endif // NDEBUG
487 487
488 NOTREACHED(); 488 NOTREACHED();
489 } 489 }
490 490
491 #endif // DCHECK_IS_ON() 491 #endif // DCHECK_IS_ON()
492 492
493 #ifndef NDEBUG 493 #ifndef NDEBUG
494 494
495 WTF::String PaintController::displayItemListAsDebugString(const DisplayItemList& list) const 495 String PaintController::displayItemListAsDebugString(const DisplayItemList& list ) const
496 { 496 {
497 StringBuilder stringBuilder; 497 StringBuilder stringBuilder;
498 size_t i = 0; 498 size_t i = 0;
499 for (auto it = list.begin(); it != list.end(); ++it, ++i) { 499 for (auto it = list.begin(); it != list.end(); ++it, ++i) {
500 const DisplayItem& displayItem = *it; 500 const DisplayItem& displayItem = *it;
501 if (i) 501 if (i)
502 stringBuilder.append(",\n"); 502 stringBuilder.append(",\n");
503 stringBuilder.append(String::format("{index: %d, ", (int)i)); 503 stringBuilder.append(String::format("{index: %d, ", (int)i));
504 displayItem.dumpPropertiesAsDebugString(stringBuilder); 504 displayItem.dumpPropertiesAsDebugString(stringBuilder);
505 if (displayItem.hasValidClient()) { 505 if (displayItem.hasValidClient()) {
506 stringBuilder.append(", cacheIsValid: "); 506 stringBuilder.append(", cacheIsValid: ");
507 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "tru e" : "false"); 507 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "tru e" : "false");
508 } 508 }
509 IntRect visualRect = list.visualRect(i);
wkorman 2016/07/01 19:04:06 I think that this can/will lead to a failed DCHECK
510 stringBuilder.append(String::format(", visualRect: [%d,%d %dx%d]",
511 visualRect.x(), visualRect.y(),
512 visualRect.width(), visualRect.height()));
509 stringBuilder.append('}'); 513 stringBuilder.append('}');
510 } 514 }
511 return stringBuilder.toString(); 515 return stringBuilder.toString();
512 } 516 }
513 517
514 void PaintController::showDebugData() const 518 void PaintController::showDebugData() const
515 { 519 {
516 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); 520 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data());
517 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); 521 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data());
518 } 522 }
519 523
520 #endif // ifndef NDEBUG 524 #endif // ifndef NDEBUG
521 525
522 } // namespace blink 526 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698