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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 82caadbd4232b58397bcdcd435dc635b10441011..4bed0cb2668e6726052469aa96c58c95e6cc1dad 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -91,7 +91,7 @@ struct UnderPaintInvalidation {
struct PaintInvalidationTracking {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
Vector<PaintInvalidationInfo> trackedPaintInvalidations;
- RefPtr<SkPicture> lastPaintedPicture;
+ sk_sp<SkPicture> lastPaintedPicture;
Region paintInvalidationRegionSinceLastPaint;
Vector<UnderPaintInvalidation> underPaintInvalidations;
};
@@ -333,10 +333,10 @@ void GraphicsLayer::paint(const IntRect* interestRect, GraphicsContext::Disabled
if (paintWithoutCommit(interestRect, disabledMode)) {
getPaintController().commitNewDisplayItems(offsetFromLayoutObjectWithSubpixelAccumulation());
if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) {
- RefPtr<SkPicture> newPicture = capturePicture();
+ sk_sp<SkPicture> newPicture = capturePicture();
checkPaintUnderInvalidations(*newPicture);
PaintInvalidationTracking& tracking = paintInvalidationTrackingMap().add(this, PaintInvalidationTracking()).storedValue->value;
- tracking.lastPaintedPicture = newPicture;
+ tracking.lastPaintedPicture = std::move(newPicture);
tracking.paintInvalidationRegionSinceLastPaint = Region();
}
}
@@ -1111,12 +1111,12 @@ void GraphicsLayer::setContentsRect(const IntRect& rect)
void GraphicsLayer::setContentsToImage(Image* image, RespectImageOrientationEnum respectImageOrientation)
{
- RefPtr<SkImage> skImage = image ? image->imageForCurrentFrame() : nullptr;
+ sk_sp<SkImage> skImage = image ? image->imageForCurrentFrame() : nullptr;
if (image && skImage && image->isBitmapImage()) {
if (respectImageOrientation == RespectImageOrientation) {
ImageOrientation imageOrientation = toBitmapImage(image)->currentFrameOrientation();
- skImage = DragImage::resizeAndOrientImage(skImage.release(), imageOrientation);
+ skImage = DragImage::resizeAndOrientImage(std::move(skImage), imageOrientation);
}
}
@@ -1244,7 +1244,7 @@ void GraphicsLayer::setCompositorMutableProperties(uint32_t properties)
layer->setCompositorMutableProperties(properties);
}
-PassRefPtr<SkPicture> GraphicsLayer::capturePicture()
+sk_sp<SkPicture> GraphicsLayer::capturePicture()
{
if (!drawsContent())
return nullptr;
@@ -1335,7 +1335,7 @@ void GraphicsLayer::checkPaintUnderInvalidations(const SkPicture& newPicture)
SkPictureRecorder recorder;
recorder.beginRecording(width, height);
recorder.getRecordingCanvas()->drawBitmap(newBitmap, 0, 0);
- RefPtr<SkPicture> picture = fromSkSp(recorder.finishRecordingAsPicture());
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
getPaintController().appendDebugDrawingAfterCommit(*this, picture, offsetFromLayoutObjectWithSubpixelAccumulation());
}
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsLayer.h ('k') | third_party/WebKit/Source/platform/graphics/Image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698