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 "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 public: | 85 public: |
86 SrcModeRectBench() : INHERITED(1, 0) { | 86 SrcModeRectBench() : INHERITED(1, 0) { |
87 fMode = SkXfermode::Create(SkXfermode::kSrc_Mode); | 87 fMode = SkXfermode::Create(SkXfermode::kSrc_Mode); |
88 } | 88 } |
89 | 89 |
90 virtual ~SrcModeRectBench() { | 90 virtual ~SrcModeRectBench() { |
91 SkSafeUnref(fMode); | 91 SkSafeUnref(fMode); |
92 } | 92 } |
93 | 93 |
94 protected: | 94 protected: |
95 virtual void setupPaint(SkPaint* paint) SK_OVERRIDE { | 95 void setupPaint(SkPaint* paint) SK_OVERRIDE { |
96 this->INHERITED::setupPaint(paint); | 96 this->INHERITED::setupPaint(paint); |
97 // srcmode is most interesting when we're not opaque | 97 // srcmode is most interesting when we're not opaque |
98 paint->setAlpha(0x80); | 98 paint->setAlpha(0x80); |
99 paint->setXfermode(fMode); | 99 paint->setXfermode(fMode); |
100 } | 100 } |
101 | 101 |
102 virtual const char* onGetName() SK_OVERRIDE { | 102 const char* onGetName() SK_OVERRIDE { |
103 fName.set(this->INHERITED::onGetName()); | 103 fName.set(this->INHERITED::onGetName()); |
104 fName.prepend("srcmode_"); | 104 fName.prepend("srcmode_"); |
105 return fName.c_str(); | 105 return fName.c_str(); |
106 } | 106 } |
107 | 107 |
108 private: | 108 private: |
109 SkString fName; | 109 SkString fName; |
110 SkXfermode* fMode; | 110 SkXfermode* fMode; |
111 | 111 |
112 typedef RectBench INHERITED; | 112 typedef RectBench INHERITED; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 BlitMaskBench::kMaskBlack, "maskblack") | 279 BlitMaskBench::kMaskBlack, "maskblack") |
280 ); ) | 280 ); ) |
281 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench, | 281 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench, |
282 (SkCanvas::kPoints_PointMode, | 282 (SkCanvas::kPoints_PointMode, |
283 BlitMaskBench::kMaskColor, "maskcolor") | 283 BlitMaskBench::kMaskColor, "maskcolor") |
284 ); ) | 284 ); ) |
285 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench, | 285 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench, |
286 (SkCanvas::kPoints_PointMode, | 286 (SkCanvas::kPoints_PointMode, |
287 BlitMaskBench::KMaskShader, "maskshader") | 287 BlitMaskBench::KMaskShader, "maskshader") |
288 ); ) | 288 ); ) |
OLD | NEW |