OLD | NEW |
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 Loading... |
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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 m_frame->client()->frameBlameContext()->Enter(); | 865 m_frame->client()->frameBlameContext()->Enter(); |
866 } | 866 } |
867 | 867 |
868 ScopedFrameBlamer::~ScopedFrameBlamer() | 868 ScopedFrameBlamer::~ScopedFrameBlamer() |
869 { | 869 { |
870 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 870 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
871 m_frame->client()->frameBlameContext()->Leave(); | 871 m_frame->client()->frameBlameContext()->Leave(); |
872 } | 872 } |
873 | 873 |
874 } // namespace blink | 874 } // namespace blink |
OLD | NEW |