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

Unified Diff: samplecode/ClockFaceView.cpp

Issue 2056343004: Add samples to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add samples.gypi Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/viewer.gyp ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/ClockFaceView.cpp
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index ef0fec75774034849bdfe84f243f406a316f9125..9cee95b84c36fd19829afa98faa1df90959f18f6 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -72,7 +72,14 @@ public:
: Sk2DPathEffect(matrix), fRadius(radius), fPts(pts) {}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Dot2DPathEffect)
-
+ class Registrar {
+ public:
+ Registrar() {
+ SkFlattenable::Register("Dot2DPathEffect",
+ Dot2DPathEffect::CreateProc,
+ Dot2DPathEffect::GetFlattenableType());
+ }
+ };
protected:
void begin(const SkIRect& uvBounds, SkPath* dst) const override {
if (fPts) {
@@ -101,6 +108,8 @@ private:
typedef Sk2DPathEffect INHERITED;
};
+static Dot2DPathEffect::Registrar gReg0;
+
sk_sp<SkFlattenable> Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) {
SkMatrix matrix;
buffer.readMatrix(&matrix);
« no previous file with comments | « gyp/viewer.gyp ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698