Commit b63dab27 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Show paint records when DCHECK_IS_ON() in various dumps

Previously they were guarded by #ifndef NDEBUG because paint record
dumping was only available in debug build.

Now still guard by DCHECK_IS_ON() so that we won't build them into
official releases.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I22886cd7a7fc1ef34069944534c6be79af63f757
Reviewed-on: https://chromium-review.googlesource.com/941419Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539927}
parent d35ebcec
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "platform/graphics/GraphicsContext.h" #include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/Image.h" #include "platform/graphics/Image.h"
#include "platform/graphics/LinkHighlight.h" #include "platform/graphics/LinkHighlight.h"
#include "platform/graphics/LoggingCanvas.h"
#include "platform/graphics/compositing/CompositedLayerRasterInvalidator.h" #include "platform/graphics/compositing/CompositedLayerRasterInvalidator.h"
#include "platform/graphics/compositing/PaintChunksToCcLayer.h" #include "platform/graphics/compositing/PaintChunksToCcLayer.h"
#include "platform/graphics/paint/DrawingRecorder.h" #include "platform/graphics/paint/DrawingRecorder.h"
...@@ -72,10 +73,6 @@ ...@@ -72,10 +73,6 @@
#include "public/platform/WebPoint.h" #include "public/platform/WebPoint.h"
#include "public/platform/WebSize.h" #include "public/platform/WebSize.h"
#ifndef NDEBUG
#include "platform/graphics/LoggingCanvas.h"
#endif
namespace blink { namespace blink {
std::unique_ptr<GraphicsLayer> GraphicsLayer::Create( std::unique_ptr<GraphicsLayer> GraphicsLayer::Create(
...@@ -881,7 +878,7 @@ std::unique_ptr<JSONObject> GraphicsLayer::LayerAsJSONInternal( ...@@ -881,7 +878,7 @@ std::unique_ptr<JSONObject> GraphicsLayer::LayerAsJSONInternal(
json->SetValue("layerOffset", PointAsJSONArray(layer_state_->offset)); json->SetValue("layerOffset", PointAsJSONArray(layer_state_->offset));
} }
#ifndef NDEBUG #if DCHECK_IS_ON()
if (DrawsContent() && (flags & kLayerTreeIncludesPaintRecords)) if (DrawsContent() && (flags & kLayerTreeIncludesPaintRecords))
json->SetValue("paintRecord", RecordAsJSON(*CapturePaintRecord())); json->SetValue("paintRecord", RecordAsJSON(*CapturePaintRecord()));
#endif #endif
......
...@@ -114,7 +114,7 @@ std::unique_ptr<JSONObject> ContentLayerClientImpl::LayerAsJSON( ...@@ -114,7 +114,7 @@ std::unique_ptr<JSONObject> ContentLayerClientImpl::LayerAsJSON(
if (int transform_id = GetTransformId(layer_state_.Transform(), context)) if (int transform_id = GetTransformId(layer_state_.Transform(), context))
json->SetInteger("transform", transform_id); json->SetInteger("transform", transform_id);
#ifndef NDEBUG #if DCHECK_IS_ON()
if (context.flags & kLayerTreeIncludesPaintRecords) { if (context.flags & kLayerTreeIncludesPaintRecords) {
LoggingCanvas canvas; LoggingCanvas canvas;
cc_display_item_list_->Raster(&canvas); cc_display_item_list_->Raster(&canvas);
......
...@@ -670,13 +670,10 @@ void PaintController::CommitNewDisplayItems() { ...@@ -670,13 +670,10 @@ void PaintController::CommitNewDisplayItems() {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
if (VLOG_IS_ON(2)) { if (VLOG_IS_ON(2)) {
LOG(ERROR) << "PaintController::CommitNewDisplayItems() done"; LOG(ERROR) << "PaintController::CommitNewDisplayItems() done";
#ifndef NDEBUG if (VLOG_IS_ON(3))
if (VLOG_IS_ON(3)) {
ShowDebugDataWithRecords(); ShowDebugDataWithRecords();
return; else
} ShowDebugData();
#endif
ShowDebugData();
} }
#endif #endif
} }
......
...@@ -202,9 +202,7 @@ class PLATFORM_EXPORT PaintController { ...@@ -202,9 +202,7 @@ class PLATFORM_EXPORT PaintController {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
void ShowDebugData() const; void ShowDebugData() const;
#ifndef NDEBUG
void ShowDebugDataWithRecords() const; void ShowDebugDataWithRecords() const;
#endif
#endif #endif
void SetTracksRasterInvalidations(bool); void SetTracksRasterInvalidations(bool);
......
...@@ -177,11 +177,9 @@ void PaintController::ShowDebugData() const { ...@@ -177,11 +177,9 @@ void PaintController::ShowDebugData() const {
return ShowDebugDataInternal(DisplayItemList::kDefault); return ShowDebugDataInternal(DisplayItemList::kDefault);
} }
#ifndef NDEBUG
void PaintController::ShowDebugDataWithRecords() const { void PaintController::ShowDebugDataWithRecords() const {
return ShowDebugDataInternal(DisplayItemList::kShowPaintRecords); return ShowDebugDataInternal(DisplayItemList::kShowPaintRecords);
} }
#endif
} // namespace blink } // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment