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

Side by Side Diff: gm/tileimagefilter.cpp

Issue 108623002: Reverting 12528 & 12533 due to N4 GM diffs (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « gm/bitmapsource.cpp ('k') | gm/xfermodeimagefilter.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 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 "SkTileImageFilter.h" 9 #include "SkTileImageFilter.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 } 64 }
65 65
66 virtual SkISize onISize() { 66 virtual SkISize onISize() {
67 return make_isize(WIDTH, HEIGHT); 67 return make_isize(WIDTH, HEIGHT);
68 } 68 }
69 69
70 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint, 70 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint,
71 SkScalar x, SkScalar y) { 71 SkScalar x, SkScalar y) {
72 canvas->save(); 72 canvas->save();
73 canvas->translate(x, y); 73 canvas->clipRect(SkRect::MakeXYWH(x, y,
74 canvas->clipRect(SkRect::MakeXYWH(0, 0,
75 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); 74 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height())));
76 canvas->drawBitmap(bitmap, 0, 0, &paint); 75 canvas->drawBitmap(bitmap, x, y, &paint);
77 canvas->restore(); 76 canvas->restore();
78 } 77 }
79 78
80 virtual void onDraw(SkCanvas* canvas) { 79 virtual void onDraw(SkCanvas* canvas) {
81 if (!fInitialized) { 80 if (!fInitialized) {
82 make_bitmap(); 81 make_bitmap();
83 make_checkerboard(); 82 make_checkerboard();
84 fInitialized = true; 83 fInitialized = true;
85 } 84 }
86 canvas->clear(0x00000000); 85 canvas->clear(0x00000000);
(...skipping 27 matching lines...) Expand all
114 SkBitmap fBitmap, fCheckerboard; 113 SkBitmap fBitmap, fCheckerboard;
115 bool fInitialized; 114 bool fInitialized;
116 }; 115 };
117 116
118 ////////////////////////////////////////////////////////////////////////////// 117 //////////////////////////////////////////////////////////////////////////////
119 118
120 static GM* MyFactory(void*) { return new TileImageFilterGM; } 119 static GM* MyFactory(void*) { return new TileImageFilterGM; }
121 static GMRegistry reg(MyFactory); 120 static GMRegistry reg(MyFactory);
122 121
123 } 122 }
OLDNEW
« no previous file with comments | « gm/bitmapsource.cpp ('k') | gm/xfermodeimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698