| 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 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 virtual SkISize onISize() { return SkISize::Make(700, 500); } | 201 virtual SkISize onISize() { return SkISize::Make(700, 500); } |
| 202 | 202 |
| 203 void draw_frame(SkCanvas* canvas, const SkRect& r) { | 203 void draw_frame(SkCanvas* canvas, const SkRect& r) { |
| 204 SkPaint paint; | 204 SkPaint paint; |
| 205 paint.setStyle(SkPaint::kStroke_Style); | 205 paint.setStyle(SkPaint::kStroke_Style); |
| 206 paint.setColor(SK_ColorRED); | 206 paint.setColor(SK_ColorRED); |
| 207 canvas->drawRect(r, paint); | 207 canvas->drawRect(r, paint); |
| 208 } | 208 } |
| 209 | 209 |
| 210 virtual uint32_t onGetFlags() const { | |
| 211 // Because of the use of drawSprite, this test is excluded | |
| 212 // from scaled replay tests because drawSprite ignores the | |
| 213 // reciprocal scale that is applied at record time, which is | |
| 214 // the intended behavior of drawSprite. | |
| 215 return kSkipScaledReplay_Flag | kSkipTiled_Flag; | |
| 216 } | |
| 217 | |
| 218 virtual void onDraw(SkCanvas* canvas) { | 210 virtual void onDraw(SkCanvas* canvas) { |
| 219 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = { | 211 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = { |
| 220 draw_paint, | 212 draw_paint, |
| 221 draw_line, draw_rect, draw_path, draw_text, | 213 draw_line, draw_rect, draw_path, draw_text, |
| 222 draw_bitmap, | 214 draw_bitmap, |
| 223 draw_sprite | 215 draw_sprite |
| 224 }; | 216 }; |
| 225 | 217 |
| 226 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED, | 218 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED, |
| 227 SkXfermode::kSrcIn_Mode); | 219 SkXfermode::kSrcIn_Mode); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 252 } |
| 261 | 253 |
| 262 private: | 254 private: |
| 263 typedef GM INHERITED; | 255 typedef GM INHERITED; |
| 264 }; | 256 }; |
| 265 | 257 |
| 266 /////////////////////////////////////////////////////////////////////////////// | 258 /////////////////////////////////////////////////////////////////////////////// |
| 267 | 259 |
| 268 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } | 260 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } |
| 269 static skiagm::GMRegistry reg(MyFactory); | 261 static skiagm::GMRegistry reg(MyFactory); |
| OLD | NEW |