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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h

Issue 1814473003: Revert of Add sk_sp helpers and switch Blink SkShader clients to the new APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 // 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
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<SkPicture> endRecording() 41 PassRefPtr<const 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698