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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Self-review. 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 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 GraphicsContext& context() { return m_pictureBuilder->context(); } 122 GraphicsContext& context() { return m_pictureBuilder->context(); }
123 123
124 std::unique_ptr<DragImage> createImage( 124 std::unique_ptr<DragImage> createImage(
125 float opacity, 125 float opacity,
126 RespectImageOrientationEnum imageOrientation = DoNotRespectImageOrientat ion) 126 RespectImageOrientationEnum imageOrientation = DoNotRespectImageOrientat ion)
127 { 127 {
128 context().getPaintController().endItem<EndTransformDisplayItem>(*m_pictu reBuilder); 128 context().getPaintController().endItem<EndTransformDisplayItem>(*m_pictu reBuilder);
129 // TODO(fmalita): endRecording() should return a non-const SKP. 129 // TODO(fmalita): endRecording() should return a non-const SKP.
130 sk_sp<SkPicture> recording(const_cast<SkPicture*>(m_pictureBuilder->endR ecording().leakRef())); 130 sk_sp<SkPicture> recording(const_cast<SkPicture*>(m_pictureBuilder->endR ecording().release()));
131 RefPtr<SkImage> skImage = fromSkSp(SkImage::MakeFromPicture(std::move(re cording), 131 sk_sp<SkImage> skImage = SkImage::MakeFromPicture(std::move(recording),
132 SkISize::Make(m_bounds.width(), m_bounds.height()), nullptr, nullptr )); 132 SkISize::Make(m_bounds.width(), m_bounds.height()), nullptr, nullptr );
133 RefPtr<Image> image = StaticBitmapImage::create(skImage.release()); 133 RefPtr<Image> image = StaticBitmapImage::create(std::move(skImage));
134 float screenDeviceScaleFactor = m_localFrame->page()->chromeClient().scr eenInfo().deviceScaleFactor; 134 float screenDeviceScaleFactor = m_localFrame->page()->chromeClient().scr eenInfo().deviceScaleFactor;
135 135
136 return DragImage::create(image.get(), imageOrientation, screenDeviceScal eFactor, InterpolationHigh, opacity); 136 return DragImage::create(image.get(), imageOrientation, screenDeviceScal eFactor, InterpolationHigh, opacity);
137 } 137 }
138 138
139 private: 139 private:
140 const Member<const LocalFrame> m_localFrame; 140 const Member<const LocalFrame> m_localFrame;
141 FloatRect m_bounds; 141 FloatRect m_bounds;
142 std::unique_ptr<SkPictureBuilder> m_pictureBuilder; 142 std::unique_ptr<SkPictureBuilder> m_pictureBuilder;
143 }; 143 };
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 m_frame->client()->frameBlameContext()->Enter(); 858 m_frame->client()->frameBlameContext()->Enter();
859 } 859 }
860 860
861 ScopedFrameBlamer::~ScopedFrameBlamer() 861 ScopedFrameBlamer::~ScopedFrameBlamer()
862 { 862 {
863 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 863 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
864 m_frame->client()->frameBlameContext()->Leave(); 864 m_frame->client()->frameBlameContext()->Leave();
865 } 865 }
866 866
867 } // namespace blink 867 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698