| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkView.h" | 9 #include "SkView.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "SkTypeface.h" | 24 #include "SkTypeface.h" |
| 25 #include "SkUtils.h" | 25 #include "SkUtils.h" |
| 26 #include "SkKey.h" | 26 #include "SkKey.h" |
| 27 #include "SkXfermode.h" | 27 #include "SkXfermode.h" |
| 28 #include "SkDrawFilter.h" | 28 #include "SkDrawFilter.h" |
| 29 | 29 |
| 30 static void make_paint(SkPaint* paint, const SkMatrix& localMatrix) { | 30 static void make_paint(SkPaint* paint, const SkMatrix& localMatrix) { |
| 31 SkColor colors[] = { 0, SK_ColorWHITE }; | 31 SkColor colors[] = { 0, SK_ColorWHITE }; |
| 32 SkPoint pts[] = { { 0, 0 }, { 0, SK_Scalar1*20 } }; | 32 SkPoint pts[] = { { 0, 0 }, { 0, SK_Scalar1*20 } }; |
| 33 SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader:
:kClamp_TileMode, | 33 SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader:
:kClamp_TileMode, |
| 34 0, &localMatrix); | 34 NULL, 0, &localMatrix); |
| 35 | 35 |
| 36 paint->setShader(s)->unref(); | 36 paint->setShader(s)->unref(); |
| 37 paint->setXfermodeMode(SkXfermode::kDstIn_Mode); | 37 paint->setXfermodeMode(SkXfermode::kDstIn_Mode); |
| 38 } | 38 } |
| 39 | 39 |
| 40 static void dump_layers(const char label[], SkCanvas* canvas) { | 40 static void dump_layers(const char label[], SkCanvas* canvas) { |
| 41 SkDebugf("Dump Layers(%s)\n", label); | 41 SkDebugf("Dump Layers(%s)\n", label); |
| 42 | 42 |
| 43 SkCanvas::LayerIter iter(canvas, true); | 43 SkCanvas::LayerIter iter(canvas, true); |
| 44 int index = 0; | 44 int index = 0; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 private: | 233 private: |
| 234 typedef SkView INHERITED; | 234 typedef SkView INHERITED; |
| 235 }; | 235 }; |
| 236 | 236 |
| 237 ////////////////////////////////////////////////////////////////////////////// | 237 ////////////////////////////////////////////////////////////////////////////// |
| 238 | 238 |
| 239 static SkView* MyFactory() { return new LayersView; } | 239 static SkView* MyFactory() { return new LayersView; } |
| 240 static SkViewRegister reg(MyFactory); | 240 static SkViewRegister reg(MyFactory); |
| OLD | NEW |