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

Side by Side Diff: gm/imageresizetiled.cpp

Issue 1014533004: SkPaint::FilterLevel -> SkFilterQuality (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « gm/imagefiltersscaled.cpp ('k') | gm/matriximagefilter.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 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 "SkMatrixImageFilter.h" 9 #include "SkMatrixImageFilter.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 18 matching lines...) Expand all
29 29
30 SkISize onISize() SK_OVERRIDE { 30 SkISize onISize() SK_OVERRIDE {
31 return SkISize::Make(WIDTH, HEIGHT); 31 return SkISize::Make(WIDTH, HEIGHT);
32 } 32 }
33 33
34 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 34 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
35 SkPaint paint; 35 SkPaint paint;
36 SkMatrix matrix; 36 SkMatrix matrix;
37 matrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR); 37 matrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR);
38 SkAutoTUnref<SkImageFilter> imageFilter( 38 SkAutoTUnref<SkImageFilter> imageFilter(
39 SkMatrixImageFilter::Create(matrix, SkPaint::kNone_FilterLevel)); 39 SkMatrixImageFilter::Create(matrix, kNone_SkFilterQuality));
40 paint.setImageFilter(imageFilter.get()); 40 paint.setImageFilter(imageFilter.get());
41 const SkScalar tile_size = SkIntToScalar(100); 41 const SkScalar tile_size = SkIntToScalar(100);
42 SkRect bounds; 42 SkRect bounds;
43 canvas->getClipBounds(&bounds); 43 canvas->getClipBounds(&bounds);
44 for (SkScalar y = 0; y < HEIGHT; y += tile_size) { 44 for (SkScalar y = 0; y < HEIGHT; y += tile_size) {
45 for (SkScalar x = 0; x < WIDTH; x += tile_size) { 45 for (SkScalar x = 0; x < WIDTH; x += tile_size) {
46 canvas->save(); 46 canvas->save();
47 canvas->clipRect(SkRect::MakeXYWH(x, y, tile_size, tile_size)); 47 canvas->clipRect(SkRect::MakeXYWH(x, y, tile_size, tile_size));
48 canvas->scale(SkScalarInvert(RESIZE_FACTOR), 48 canvas->scale(SkScalarInvert(RESIZE_FACTOR),
49 SkScalarInvert(RESIZE_FACTOR)); 49 SkScalarInvert(RESIZE_FACTOR));
(...skipping 22 matching lines...) Expand all
72 72
73 private: 73 private:
74 typedef GM INHERITED; 74 typedef GM INHERITED;
75 }; 75 };
76 76
77 ////////////////////////////////////////////////////////////////////////////// 77 //////////////////////////////////////////////////////////////////////////////
78 78
79 DEF_GM(return new ImageResizeTiledGM(); ) 79 DEF_GM(return new ImageResizeTiledGM(); )
80 80
81 } 81 }
OLDNEW
« no previous file with comments | « gm/imagefiltersscaled.cpp ('k') | gm/matriximagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698