Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: gm/offsetimagefilter.cpp

Issue 1236133003: increase gm offsetimagefilter stroke width (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkOffsetImageFilter.h" 10 #include "SkOffsetImageFilter.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 canvas->scale(scale, scale); 50 canvas->scale(scale, scale);
51 canvas->drawBitmap(bitmap, 0, 0, &paint); 51 canvas->drawBitmap(bitmap, 0, 0, &paint);
52 canvas->restore(); 52 canvas->restore();
53 53
54 // Draw a boundary rect around the intersection of the clip rect and cro p rect. 54 // Draw a boundary rect around the intersection of the clip rect and cro p rect.
55 SkRect cropRectFloat; 55 SkRect cropRectFloat;
56 SkMatrix::MakeScale(scale, scale).mapRect(&cropRectFloat, SkRect::Make(c ropRect)); 56 SkMatrix::MakeScale(scale, scale).mapRect(&cropRectFloat, SkRect::Make(c ropRect));
57 if (clipRect.intersect(cropRectFloat)) { 57 if (clipRect.intersect(cropRectFloat)) {
58 SkPaint strokePaint; 58 SkPaint strokePaint;
59 strokePaint.setStyle(SkPaint::kStroke_Style); 59 strokePaint.setStyle(SkPaint::kStroke_Style);
60 strokePaint.setStrokeWidth(2);
60 strokePaint.setColor(SK_ColorRED); 61 strokePaint.setColor(SK_ColorRED);
61 canvas->drawRect(clipRect, strokePaint); 62 canvas->drawRect(clipRect, strokePaint);
62 } 63 }
63 } 64 }
64 65
65 void onOnceBeforeDraw() override { 66 void onOnceBeforeDraw() override {
66 make_bitmap(); 67 make_bitmap();
67 68
68 fCheckerboard.allocN32Pixels(80, 80); 69 fCheckerboard.allocN32Pixels(80, 80);
69 SkCanvas checkerboardCanvas(fCheckerboard); 70 SkCanvas checkerboardCanvas(fCheckerboard);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 206
206 // crop==clip==dst 207 // crop==clip==dst
207 canvas->translate(100, 0); 208 canvas->translate(100, 0);
208 this->doDraw(canvas, r, SkOffsetImageFilter::Create(40, 0, NULL, &cr2), &r2); 209 this->doDraw(canvas, r, SkOffsetImageFilter::Create(40, 0, NULL, &cr2), &r2);
209 } 210 }
210 211
211 private: 212 private:
212 typedef skiagm::GM INHERITED; 213 typedef skiagm::GM INHERITED;
213 }; 214 };
214 DEF_GM( return new SimpleOffsetImageFilterGM; ) 215 DEF_GM( return new SimpleOffsetImageFilterGM; )
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698