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

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

Issue 2905023002: Remove WTFLogAlways() usages from platform/graphics/ (Closed)
Patch Set: Remove \n and use of .Utf8().data() Created 3 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp ('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/graphics/GraphicsLayer.h" 7 #include "platform/graphics/GraphicsLayer.h"
8 #include "platform/graphics/paint/DrawingDisplayItem.h" 8 #include "platform/graphics/paint/DrawingDisplayItem.h"
9 #include "platform/instrumentation/tracing/TraceEvent.h" 9 #include "platform/instrumentation/tracing/TraceEvent.h"
10 #include "platform/wtf/AutoReset.h" 10 #include "platform/wtf/AutoReset.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 if (begin_display_item.IsBegin() && !begin_display_item.DrawsContent()) 280 if (begin_display_item.IsBegin() && !begin_display_item.DrawsContent())
281 DCHECK(!display_item.IsEndAndPairedWith(begin_display_item.GetType())); 281 DCHECK(!display_item.IsEndAndPairedWith(begin_display_item.GetType()));
282 } 282 }
283 283
284 size_t index = FindMatchingItemFromIndex(display_item.GetId(), 284 size_t index = FindMatchingItemFromIndex(display_item.GetId(),
285 new_display_item_indices_by_client_, 285 new_display_item_indices_by_client_,
286 new_display_item_list_); 286 new_display_item_list_);
287 if (index != kNotFound) { 287 if (index != kNotFound) {
288 #ifndef NDEBUG 288 #ifndef NDEBUG
289 ShowDebugData(); 289 ShowDebugData();
290 WTFLogAlways( 290 DLOG(INFO) << "DisplayItem " << display_item.AsDebugString()
291 "DisplayItem %s has duplicated id with previous %s (index=%zu)\n", 291 << " has duplicated id with previous "
292 display_item.AsDebugString().Utf8().data(), 292 << new_display_item_list_[index].AsDebugString()
293 new_display_item_list_[index].AsDebugString().Utf8().data(), index); 293 << " (index=" << index << ")";
294 #endif 294 #endif
295 NOTREACHED(); 295 NOTREACHED();
296 } 296 }
297 AddItemToIndexIfNeeded(display_item, new_display_item_list_.size() - 1, 297 AddItemToIndexIfNeeded(display_item, new_display_item_list_.size() - 1,
298 new_display_item_indices_by_client_); 298 new_display_item_indices_by_client_);
299 #endif // DCHECK_IS_ON() 299 #endif // DCHECK_IS_ON()
300 300
301 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) 301 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled())
302 CheckUnderInvalidation(); 302 CheckUnderInvalidation();
303 303
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 // non-under-invalidation-checking path to empty the original cached slot, 954 // non-under-invalidation-checking path to empty the original cached slot,
955 // leaving only disappeared or invalidated display items in the old list after 955 // leaving only disappeared or invalidated display items in the old list after
956 // painting. 956 // painting.
957 new_display_item_list_.RemoveLast(); 957 new_display_item_list_.RemoveLast();
958 MoveItemFromCurrentListToNewList(old_item_index); 958 MoveItemFromCurrentListToNewList(old_item_index);
959 959
960 ++under_invalidation_checking_begin_; 960 ++under_invalidation_checking_begin_;
961 } 961 }
962 962
963 void PaintController::ShowDebugDataInternal(bool show_paint_records) const { 963 void PaintController::ShowDebugDataInternal(bool show_paint_records) const {
964 WTFLogAlways("current display item list: [%s]\n", 964 DLOG(INFO) << "current display item list: ["
965 current_paint_artifact_.GetDisplayItemList() 965 << current_paint_artifact_.GetDisplayItemList()
966 .SubsequenceAsJSON( 966 .SubsequenceAsJSON(
967 0, current_paint_artifact_.GetDisplayItemList().size(), 967 0, current_paint_artifact_.GetDisplayItemList().size(),
968 show_paint_records 968 show_paint_records
969 ? DisplayItemList::JsonOptions::kShowPaintRecords 969 ? DisplayItemList::JsonOptions::kShowPaintRecords
970 : DisplayItemList::JsonOptions::kDefault) 970 : DisplayItemList::JsonOptions::kDefault)
971 ->ToPrettyJSONString() 971 ->ToPrettyJSONString()
972 .Utf8() 972 << "]";
973 .data());
974 // debugName() and clientCacheIsValid() can only be called on a live 973 // debugName() and clientCacheIsValid() can only be called on a live
975 // client, so only output it for m_newDisplayItemList, in which we are 974 // client, so only output it for m_newDisplayItemList, in which we are
976 // sure the clients are all alive. 975 // sure the clients are all alive.
977 WTFLogAlways( 976 DLOG(INFO)
978 "new display item list: [%s]\n", 977 << "new display item list: ["
979 new_display_item_list_ 978 << new_display_item_list_
980 .SubsequenceAsJSON( 979 .SubsequenceAsJSON(
981 0, new_display_item_list_.size(), 980 0, new_display_item_list_.size(),
982 show_paint_records 981 show_paint_records
983 ? (DisplayItemList::JsonOptions::kShowPaintRecords | 982 ? (DisplayItemList::JsonOptions::kShowPaintRecords |
984 DisplayItemList::JsonOptions::kShowClientDebugName) 983 DisplayItemList::JsonOptions::kShowClientDebugName)
985 : DisplayItemList::JsonOptions::kShowClientDebugName) 984 : DisplayItemList::JsonOptions::kShowClientDebugName)
986 ->ToPrettyJSONString() 985 ->ToPrettyJSONString()
987 .Utf8() 986 << "]";
988 .data());
989 } 987 }
990 988
991 void PaintController::SetFirstPainted() { 989 void PaintController::SetFirstPainted() {
992 frame_first_paints_.back().first_painted = true; 990 frame_first_paints_.back().first_painted = true;
993 } 991 }
994 992
995 void PaintController::SetTextPainted() { 993 void PaintController::SetTextPainted() {
996 frame_first_paints_.back().text_painted = true; 994 frame_first_paints_.back().text_painted = true;
997 } 995 }
998 996
999 void PaintController::SetImagePainted() { 997 void PaintController::SetImagePainted() {
1000 frame_first_paints_.back().image_painted = true; 998 frame_first_paints_.back().image_painted = true;
1001 } 999 }
1002 1000
1003 void PaintController::BeginFrame(const void* frame) { 1001 void PaintController::BeginFrame(const void* frame) {
1004 frame_first_paints_.push_back(FrameFirstPaint(frame)); 1002 frame_first_paints_.push_back(FrameFirstPaint(frame));
1005 } 1003 }
1006 1004
1007 FrameFirstPaint PaintController::EndFrame(const void* frame) { 1005 FrameFirstPaint PaintController::EndFrame(const void* frame) {
1008 FrameFirstPaint result = frame_first_paints_.back(); 1006 FrameFirstPaint result = frame_first_paints_.back();
1009 DCHECK(result.frame == frame); 1007 DCHECK(result.frame == frame);
1010 frame_first_paints_.pop_back(); 1008 frame_first_paints_.pop_back();
1011 return result; 1009 return result;
1012 } 1010 }
1013 1011
1014 } // namespace blink 1012 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698