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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #include "core/svg/SVGDocumentExtensions.h" | 77 #include "core/svg/SVGDocumentExtensions.h" |
78 #include "core/timing/Performance.h" | 78 #include "core/timing/Performance.h" |
79 #include "platform/DragImage.h" | 79 #include "platform/DragImage.h" |
80 #include "platform/PluginScriptForbiddenScope.h" | 80 #include "platform/PluginScriptForbiddenScope.h" |
81 #include "platform/RuntimeEnabledFeatures.h" | 81 #include "platform/RuntimeEnabledFeatures.h" |
82 #include "platform/ScriptForbiddenScope.h" | 82 #include "platform/ScriptForbiddenScope.h" |
83 #include "platform/WebFrameScheduler.h" | 83 #include "platform/WebFrameScheduler.h" |
84 #include "platform/graphics/GraphicsContext.h" | 84 #include "platform/graphics/GraphicsContext.h" |
85 #include "platform/graphics/StaticBitmapImage.h" | 85 #include "platform/graphics/StaticBitmapImage.h" |
86 #include "platform/graphics/paint/ClipRecorder.h" | 86 #include "platform/graphics/paint/ClipRecorder.h" |
| 87 #include "platform/graphics/paint/PaintCanvas.h" |
87 #include "platform/graphics/paint/PaintController.h" | 88 #include "platform/graphics/paint/PaintController.h" |
88 #include "platform/graphics/paint/SkPictureBuilder.h" | 89 #include "platform/graphics/paint/SkPictureBuilder.h" |
89 #include "platform/graphics/paint/TransformDisplayItem.h" | 90 #include "platform/graphics/paint/TransformDisplayItem.h" |
90 #include "platform/json/JSONValues.h" | 91 #include "platform/json/JSONValues.h" |
91 #include "platform/plugins/PluginData.h" | 92 #include "platform/plugins/PluginData.h" |
92 #include "platform/text/TextStream.h" | 93 #include "platform/text/TextStream.h" |
93 #include "public/platform/InterfaceProvider.h" | 94 #include "public/platform/InterfaceProvider.h" |
94 #include "public/platform/InterfaceRegistry.h" | 95 #include "public/platform/InterfaceRegistry.h" |
95 #include "public/platform/WebScreenInfo.h" | 96 #include "public/platform/WebScreenInfo.h" |
96 #include "public/platform/WebViewScheduler.h" | 97 #include "public/platform/WebViewScheduler.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 137 |
137 GraphicsContext& context() { return m_pictureBuilder->context(); } | 138 GraphicsContext& context() { return m_pictureBuilder->context(); } |
138 | 139 |
139 std::unique_ptr<DragImage> createImage( | 140 std::unique_ptr<DragImage> createImage( |
140 float opacity, | 141 float opacity, |
141 RespectImageOrientationEnum imageOrientation = | 142 RespectImageOrientationEnum imageOrientation = |
142 DoNotRespectImageOrientation) { | 143 DoNotRespectImageOrientation) { |
143 context().getPaintController().endItem<EndTransformDisplayItem>( | 144 context().getPaintController().endItem<EndTransformDisplayItem>( |
144 *m_pictureBuilder); | 145 *m_pictureBuilder); |
145 // TODO(fmalita): endRecording() should return a non-const SKP. | 146 // TODO(fmalita): endRecording() should return a non-const SKP. |
146 sk_sp<SkPicture> recording( | 147 sk_sp<PaintRecord> recording( |
147 const_cast<SkPicture*>(m_pictureBuilder->endRecording().release())); | 148 const_cast<PaintRecord*>(m_pictureBuilder->endRecording().release())); |
148 | 149 |
149 // Rasterize upfront, since DragImage::create() is going to do it anyway | 150 // Rasterize upfront, since DragImage::create() is going to do it anyway |
150 // (SkImage::asLegacyBitmap). | 151 // (SkImage::asLegacyBitmap). |
151 SkSurfaceProps surfaceProps(0, kUnknown_SkPixelGeometry); | 152 SkSurfaceProps surfaceProps(0, kUnknown_SkPixelGeometry); |
152 sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul( | 153 sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul( |
153 m_bounds.width(), m_bounds.height(), &surfaceProps); | 154 m_bounds.width(), m_bounds.height(), &surfaceProps); |
154 if (!surface) | 155 if (!surface) |
155 return nullptr; | 156 return nullptr; |
156 | 157 |
157 surface->getCanvas()->drawPicture(recording); | 158 surface->getCanvas()->drawPicture(recording); |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 944 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
944 m_frame->client()->frameBlameContext()->Enter(); | 945 m_frame->client()->frameBlameContext()->Enter(); |
945 } | 946 } |
946 | 947 |
947 ScopedFrameBlamer::~ScopedFrameBlamer() { | 948 ScopedFrameBlamer::~ScopedFrameBlamer() { |
948 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 949 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
949 m_frame->client()->frameBlameContext()->Leave(); | 950 m_frame->client()->frameBlameContext()->Leave(); |
950 } | 951 } |
951 | 952 |
952 } // namespace blink | 953 } // namespace blink |
OLD | NEW |