OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SkPictureBuilder_h | 5 #ifndef SkPictureBuilder_h |
6 #define SkPictureBuilder_h | 6 #define SkPictureBuilder_h |
7 | 7 |
8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
10 #include "platform/graphics/paint/PaintController.h" | 10 #include "platform/graphics/paint/PaintController.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 m_context = adoptPtr(new GraphicsContext(*m_paintController, disabledMod
e, metaData)); | 31 m_context = adoptPtr(new GraphicsContext(*m_paintController, disabledMod
e, metaData)); |
32 | 32 |
33 if (containingContext) { | 33 if (containingContext) { |
34 m_context->setDeviceScaleFactor(containingContext->deviceScaleFactor
()); | 34 m_context->setDeviceScaleFactor(containingContext->deviceScaleFactor
()); |
35 m_context->setPrinting(containingContext->printing()); | 35 m_context->setPrinting(containingContext->printing()); |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 GraphicsContext& context() { return *m_context; } | 39 GraphicsContext& context() { return *m_context; } |
40 | 40 |
41 PassRefPtr<const SkPicture> endRecording() | 41 PassRefPtr<SkPicture> endRecording() |
42 { | 42 { |
43 m_context->beginRecording(m_bounds); | 43 m_context->beginRecording(m_bounds); |
44 m_paintController->endSkippingCache(); | 44 m_paintController->endSkippingCache(); |
45 m_paintController->commitNewDisplayItems(); | 45 m_paintController->commitNewDisplayItems(); |
46 m_paintController->paintArtifact().replay(*m_context); | 46 m_paintController->paintArtifact().replay(*m_context); |
47 return m_context->endRecording(); | 47 return m_context->endRecording(); |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
51 OwnPtr<PaintController> m_paintController; | 51 OwnPtr<PaintController> m_paintController; |
52 OwnPtr<GraphicsContext> m_context; | 52 OwnPtr<GraphicsContext> m_context; |
53 FloatRect m_bounds; | 53 FloatRect m_bounds; |
54 }; | 54 }; |
55 | 55 |
56 } // namespace blink | 56 } // namespace blink |
57 | 57 |
58 #endif // SkPictureBuilder_h | 58 #endif // SkPictureBuilder_h |
OLD | NEW |