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 | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
9 * rights reserved. | 9 * rights reserved. |
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 RespectImageOrientationEnum imageOrientation = | 141 RespectImageOrientationEnum imageOrientation = |
142 DoNotRespectImageOrientation) { | 142 DoNotRespectImageOrientation) { |
143 context().getPaintController().endItem<EndTransformDisplayItem>( | 143 context().getPaintController().endItem<EndTransformDisplayItem>( |
144 *m_pictureBuilder); | 144 *m_pictureBuilder); |
145 // TODO(fmalita): endRecording() should return a non-const SKP. | 145 // TODO(fmalita): endRecording() should return a non-const SKP. |
146 sk_sp<SkPicture> recording( | 146 sk_sp<SkPicture> recording( |
147 const_cast<SkPicture*>(m_pictureBuilder->endRecording().release())); | 147 const_cast<SkPicture*>(m_pictureBuilder->endRecording().release())); |
148 | 148 |
149 // Rasterize upfront, since DragImage::create() is going to do it anyway | 149 // Rasterize upfront, since DragImage::create() is going to do it anyway |
150 // (SkImage::asLegacyBitmap). | 150 // (SkImage::asLegacyBitmap). |
151 sk_sp<SkSurface> surface = | 151 SkSurfaceProps surfaceProps(0, kUnknown_SkPixelGeometry); |
152 SkSurface::MakeRasterN32Premul(m_bounds.width(), m_bounds.height()); | 152 sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul( |
| 153 m_bounds.width(), m_bounds.height(), &surfaceProps); |
153 if (!surface) | 154 if (!surface) |
154 return nullptr; | 155 return nullptr; |
155 | 156 |
156 surface->getCanvas()->drawPicture(recording); | 157 surface->getCanvas()->drawPicture(recording); |
157 RefPtr<Image> image = | 158 RefPtr<Image> image = |
158 StaticBitmapImage::create(surface->makeImageSnapshot()); | 159 StaticBitmapImage::create(surface->makeImageSnapshot()); |
159 | 160 |
160 float screenDeviceScaleFactor = | 161 float screenDeviceScaleFactor = |
161 m_localFrame->page()->chromeClient().screenInfo().deviceScaleFactor; | 162 m_localFrame->page()->chromeClient().screenInfo().deviceScaleFactor; |
162 | 163 |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 943 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
943 m_frame->client()->frameBlameContext()->Enter(); | 944 m_frame->client()->frameBlameContext()->Enter(); |
944 } | 945 } |
945 | 946 |
946 ScopedFrameBlamer::~ScopedFrameBlamer() { | 947 ScopedFrameBlamer::~ScopedFrameBlamer() { |
947 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 948 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
948 m_frame->client()->frameBlameContext()->Leave(); | 949 m_frame->client()->frameBlameContext()->Leave(); |
949 } | 950 } |
950 | 951 |
951 } // namespace blink | 952 } // namespace blink |
OLD | NEW |