| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 virtual SkISize onISize() { return SkISize::Make(400, 656); } | 105 virtual SkISize onISize() { return SkISize::Make(400, 656); } |
| 106 | 106 |
| 107 void draw_frame(SkCanvas* canvas, const SkRect& r) { | 107 void draw_frame(SkCanvas* canvas, const SkRect& r) { |
| 108 SkPaint paint; | 108 SkPaint paint; |
| 109 paint.setStyle(SkPaint::kStroke_Style); | 109 paint.setStyle(SkPaint::kStroke_Style); |
| 110 paint.setColor(SK_ColorRED); | 110 paint.setColor(SK_ColorRED); |
| 111 canvas->drawRect(r, paint); | 111 canvas->drawRect(r, paint); |
| 112 } | 112 } |
| 113 | 113 |
| 114 virtual uint32_t onGetFlags() const { | |
| 115 // Because of the use of drawSprite, this test is excluded | |
| 116 // from scaled replay tests because drawSprite ignores the | |
| 117 // reciprocal scale that is applied at record time, which is | |
| 118 // the intended behavior of drawSprite. | |
| 119 return kSkipScaledReplay_Flag | kSkipTiled_Flag; | |
| 120 } | |
| 121 | |
| 122 virtual void onDraw(SkCanvas* canvas) { | 114 virtual void onDraw(SkCanvas* canvas) { |
| 123 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = { | 115 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = { |
| 124 draw_sprite, draw_bitmap, draw_path, draw_paint, draw_text | 116 draw_sprite, draw_bitmap, draw_path, draw_paint, draw_text |
| 125 }; | 117 }; |
| 126 | 118 |
| 127 SkAutoTUnref<SkColorFilter> cf( | 119 SkAutoTUnref<SkColorFilter> cf( |
| 128 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_
Mode)); | 120 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_
Mode)); |
| 129 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get
())); | 121 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get
())); |
| 130 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10,
44, 44)), | 122 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10,
44, 44)), |
| 131 SkImageFilter::CropRect::kHasAll_CropEd
ge); | 123 SkImageFilter::CropRect::kHasAll_CropEd
ge); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 164 } |
| 173 | 165 |
| 174 private: | 166 private: |
| 175 typedef GM INHERITED; | 167 typedef GM INHERITED; |
| 176 }; | 168 }; |
| 177 | 169 |
| 178 /////////////////////////////////////////////////////////////////////////////// | 170 /////////////////////////////////////////////////////////////////////////////// |
| 179 | 171 |
| 180 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } | 172 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } |
| 181 static skiagm::GMRegistry reg(MyFactory); | 173 static skiagm::GMRegistry reg(MyFactory); |
| OLD | NEW |