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

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

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Rebasing... 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
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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // the rounded clips vector in ClipDisplayItem, which is not expected to 508 // the rounded clips vector in ClipDisplayItem, which is not expected to
509 // contribute significantly to memory usage. 509 // contribute significantly to memory usage.
510 510
511 // Memory outside this class due to m_newDisplayItemList. 511 // Memory outside this class due to m_newDisplayItemList.
512 DCHECK(m_newDisplayItemList.isEmpty()); 512 DCHECK(m_newDisplayItemList.isEmpty());
513 memoryUsage += m_newDisplayItemList.memoryUsageInBytes(); 513 memoryUsage += m_newDisplayItemList.memoryUsageInBytes();
514 514
515 return memoryUsage; 515 return memoryUsage;
516 } 516 }
517 517
518 void PaintController::appendDebugDrawingAfterCommit(const DisplayItemClient& dis playItemClient, PassRefPtr<SkPicture> picture, const LayoutSize& offsetFromLayou tObject) 518 void PaintController::appendDebugDrawingAfterCommit(const DisplayItemClient& dis playItemClient, sk_sp<SkPicture> picture, const LayoutSize& offsetFromLayoutObje ct)
519 { 519 {
520 DCHECK(m_newDisplayItemList.isEmpty()); 520 DCHECK(m_newDisplayItemList.isEmpty());
521 DrawingDisplayItem& displayItem = m_currentPaintArtifact.getDisplayItemList( ).allocateAndConstruct<DrawingDisplayItem>(displayItemClient, DisplayItem::kDebu gDrawing, picture); 521 DrawingDisplayItem& displayItem = m_currentPaintArtifact.getDisplayItemList( ).allocateAndConstruct<DrawingDisplayItem>(displayItemClient, DisplayItem::kDebu gDrawing, std::move(picture));
522 displayItem.setSkippedCache(); 522 displayItem.setSkippedCache();
523 // TODO(wkorman): Only compute and append visual rect for drawings. 523 // TODO(wkorman): Only compute and append visual rect for drawings.
524 m_currentPaintArtifact.getDisplayItemList().appendVisualRect(visualRectForDi splayItem(displayItem, offsetFromLayoutObject)); 524 m_currentPaintArtifact.getDisplayItemList().appendVisualRect(visualRectForDi splayItem(displayItem, offsetFromLayoutObject));
525 } 525 }
526 526
527 void PaintController::generateChunkRasterInvalidationRects(PaintChunk& newChunk) 527 void PaintController::generateChunkRasterInvalidationRects(PaintChunk& newChunk)
528 { 528 {
529 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 529 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
530 if (m_currentChunkIsFromCachedSubsequence) 530 if (m_currentChunkIsFromCachedSubsequence)
531 return; 531 return;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 return stringBuilder.toString(); 708 return stringBuilder.toString();
709 } 709 }
710 710
711 void PaintController::showDebugData() const 711 void PaintController::showDebugData() const
712 { 712 {
713 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); 713 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data());
714 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); 714 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data());
715 } 715 }
716 716
717 } // namespace blink 717 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698