| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #include "sk_tool_utils.h" | 7 #include "sk_tool_utils.h" |
| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 r.set(0, 0, SkIntToScalar(n), SkIntToScalar(n)); | 93 r.set(0, 0, SkIntToScalar(n), SkIntToScalar(n)); |
| 94 r.inset(SK_Scalar1, SK_Scalar1); | 94 r.inset(SK_Scalar1, SK_Scalar1); |
| 95 | 95 |
| 96 SkPaint paint; | 96 SkPaint paint; |
| 97 paint.setAntiAlias(true); | 97 paint.setAntiAlias(true); |
| 98 | 98 |
| 99 paint.setColor(SK_ColorRED); | 99 paint.setColor(SK_ColorRED); |
| 100 canvas.drawOval(r, paint); | 100 canvas.drawOval(r, paint); |
| 101 | 101 |
| 102 r.inset(SK_Scalar1*n/4, SK_Scalar1*n/4); | 102 r.inset(SK_Scalar1*n/4, SK_Scalar1*n/4); |
| 103 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 103 paint.setBlendMode(SkBlendMode::kSrc); |
| 104 paint.setColor(0x800000FF); | 104 paint.setColor(0x800000FF); |
| 105 canvas.drawOval(r, paint); | 105 canvas.drawOval(r, paint); |
| 106 | 106 |
| 107 return bitmap; | 107 return bitmap; |
| 108 } | 108 } |
| 109 | 109 |
| 110 class ColorFilterView : public SampleView { | 110 class ColorFilterView : public SampleView { |
| 111 SkBitmap fBitmap; | 111 SkBitmap fBitmap; |
| 112 sk_sp<SkShader> fShader; | 112 sk_sp<SkShader> fShader; |
| 113 enum { | 113 enum { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 | 191 |
| 192 private: | 192 private: |
| 193 typedef SampleView INHERITED; | 193 typedef SampleView INHERITED; |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 ////////////////////////////////////////////////////////////////////////////// | 196 ////////////////////////////////////////////////////////////////////////////// |
| 197 | 197 |
| 198 static SkView* MyFactory() { return new ColorFilterView; } | 198 static SkView* MyFactory() { return new ColorFilterView; } |
| 199 static SkViewRegister reg(MyFactory); | 199 static SkViewRegister reg(MyFactory); |
| OLD | NEW |