2 * Copyright 2016 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
9 #include "sk_tool_utils.h"
10 #include "SkBlurMask.h"
11 #include "SkBlurMaskFilter.h"
14 class SimpleRectGM : public skiagm::GM {
19 SkString onShortName() override {
21 name.printf("simplerect");
25 SkISize onISize() override {
26 return SkISize::Make(800, 800);
29 void onDraw(SkCanvas* canvas) override {
30 canvas->translate(1, 1); // want to exercise non-identity ctm performance
32 const SkScalar min = -20;
33 const SkScalar max = 800;
34 const SkScalar size = 20;
38 for (int i = 0; i < 10000; i++) {
39 paint.setColor(sk_tool_utils::color_to_565(rand.nextU() | (0xFF << 24)));
40 SkScalar x = rand.nextRangeScalar(min, max);
41 SkScalar y = rand.nextRangeScalar(min, max);
42 SkScalar w = rand.nextRangeScalar(0, size);
43 SkScalar h = rand.nextRangeScalar(0, size);
44 canvas->drawRect(SkRect::MakeXYWH(x, y, w, h), paint);
48 bool onAnimate(const SkAnimTimer& timer) override {
56 DEF_GM(return new SimpleRectGM;)