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

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

Issue 2218533002: Backporting JSONValues from protocol::Values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch back to partition allocator Created 4 years, 4 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef LoggingCanvas_h 31 #ifndef LoggingCanvas_h
32 #define LoggingCanvas_h 32 #define LoggingCanvas_h
33 33
34 #include "platform/JSONValues.h" 34 #include "platform/JSONValues.h"
35 #include "platform/graphics/InterceptingCanvas.h" 35 #include "platform/graphics/InterceptingCanvas.h"
36 #include <memory>
36 37
37 namespace blink { 38 namespace blink {
38 39
39 class LoggingCanvas : public InterceptingCanvasBase { 40 class LoggingCanvas : public InterceptingCanvasBase {
40 public: 41 public:
41 LoggingCanvas(int width, int height); 42 LoggingCanvas(int width, int height);
42 PassRefPtr<JSONArray> log(); 43
44 // Returns a snapshot of the current log data.
45 std::unique_ptr<JSONArray> log();
43 46
44 void onDrawPaint(const SkPaint&) override; 47 void onDrawPaint(const SkPaint&) override;
45 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain t&) override; 48 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain t&) override;
46 void onDrawRect(const SkRect&, const SkPaint&) override; 49 void onDrawRect(const SkRect&, const SkPaint&) override;
47 void onDrawOval(const SkRect&, const SkPaint&) override; 50 void onDrawOval(const SkRect&, const SkPaint&) override;
48 void onDrawRRect(const SkRRect&, const SkPaint&) override; 51 void onDrawRRect(const SkRRect&, const SkPaint&) override;
49 void onDrawPath(const SkPath&, const SkPaint&) override; 52 void onDrawPath(const SkPath&, const SkPaint&) override;
50 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain t*) override; 53 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain t*) override;
51 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, SrcRectConstraint) override; 54 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, SrcRectConstraint) override;
52 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, const SkPaint*) override; 55 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, const SkPaint*) override;
(...skipping 15 matching lines...) Expand all
68 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint* ); 71 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint* );
69 void didSetMatrix(const SkMatrix&) override; 72 void didSetMatrix(const SkMatrix&) override;
70 void didConcat(const SkMatrix&) override; 73 void didConcat(const SkMatrix&) override;
71 void willSave() override; 74 void willSave() override;
72 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override; 75 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override;
73 void willRestore() override; 76 void willRestore() override;
74 77
75 private: 78 private:
76 friend class AutoLogger; 79 friend class AutoLogger;
77 80
78 RefPtr<JSONArray> m_log; 81 std::unique_ptr<JSONArray> m_log;
79 }; 82 };
80 83
81 #ifndef NDEBUG 84 #ifndef NDEBUG
82 String pictureAsDebugString(const SkPicture*); 85 String pictureAsDebugString(const SkPicture*);
83 void showSkPicture(const SkPicture*); 86 void showSkPicture(const SkPicture*);
84 #endif 87 #endif
85 88
86 } // namespace blink 89 } // namespace blink
87 90
88 #endif // LoggingCanvas_h 91 #endif // LoggingCanvas_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698