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

Side by Side Diff: samplecode/SampleBitmapRect.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 | « samplecode/SampleApp.cpp ('k') | samplecode/SampleCamera.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 2011 Google Inc. 2 * Copyright 2011 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkAnimTimer.h" 9 #include "SkAnimTimer.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 SkBitmap bitmap; 124 SkBitmap bitmap;
125 make_bitmap(&bitmap); 125 make_bitmap(&bitmap);
126 126
127 canvas->translate(20, 20); 127 canvas->translate(20, 20);
128 128
129 canvas->drawBitmap(bitmap, 0, 0, &paint); 129 canvas->drawBitmap(bitmap, 0, 0, &paint);
130 canvas->drawRect(srcR, paint); 130 canvas->drawRect(srcR, paint);
131 131
132 for (int i = 0; i < 2; ++i) { 132 for (int i = 0; i < 2; ++i) {
133 paint.setFilterLevel(1 == i ? SkPaint::kLow_FilterLevel : SkPaint::k None_FilterLevel); 133 paint.setFilterQuality(1 == i ? kLow_SkFilterQuality : kNone_SkFilte rQuality);
134 canvas->drawBitmapRectToRect(bitmap, &srcR, fDstR[i], &paint); 134 canvas->drawBitmapRectToRect(bitmap, &srcR, fDstR[i], &paint);
135 canvas->drawRect(fDstR[i], paint); 135 canvas->drawRect(fDstR[i], paint);
136 } 136 }
137 } 137 }
138 138
139 bool onAnimate(const SkAnimTimer& timer) SK_OVERRIDE { 139 bool onAnimate(const SkAnimTimer& timer) SK_OVERRIDE {
140 if (timer.isStopped()) { 140 if (timer.isStopped()) {
141 this->resetBounce(); 141 this->resetBounce();
142 } else if (timer.isRunning()) { 142 } else if (timer.isRunning()) {
143 this->bounce(); 143 this->bounce();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 return this->INHERITED::onQuery(evt); 218 return this->INHERITED::onQuery(evt);
219 } 219 }
220 220
221 void onDrawContent(SkCanvas* canvas) SK_OVERRIDE { 221 void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
222 SkPaint paint; 222 SkPaint paint;
223 paint.setStyle(SkPaint::kStroke_Style); 223 paint.setStyle(SkPaint::kStroke_Style);
224 paint.setColor(SK_ColorYELLOW); 224 paint.setColor(SK_ColorYELLOW);
225 225
226 for (int i = 0; i < 2; ++i) { 226 for (int i = 0; i < 2; ++i) {
227 paint.setFilterLevel(1 == i ? SkPaint::kLow_FilterLevel : SkPaint::k None_FilterLevel); 227 paint.setFilterQuality(1 == i ? kLow_SkFilterQuality : kNone_SkFilte rQuality);
228 canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR[i], &paint); 228 canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR[i], &paint);
229 canvas->drawRect(fDstR[i], paint); 229 canvas->drawRect(fDstR[i], paint);
230 } 230 }
231 } 231 }
232 232
233 bool onAnimate(const SkAnimTimer& timer) SK_OVERRIDE { 233 bool onAnimate(const SkAnimTimer& timer) SK_OVERRIDE {
234 if (timer.isStopped()) { 234 if (timer.isStopped()) {
235 this->resetBounce(); 235 this->resetBounce();
236 } else if (timer.isRunning()) { 236 } else if (timer.isRunning()) {
237 this->bounceMe(); 237 this->bounceMe();
238 } 238 }
239 return true; 239 return true;
240 } 240 }
241 241
242 private: 242 private:
243 typedef SampleView INHERITED; 243 typedef SampleView INHERITED;
244 }; 244 };
245 245
246 ////////////////////////////////////////////////////////////////////////////// 246 //////////////////////////////////////////////////////////////////////////////
247 247
248 static SkView* F0() { return new BitmapRectView; } 248 static SkView* F0() { return new BitmapRectView; }
249 static SkView* F1() { return new BitmapRectView2; } 249 static SkView* F1() { return new BitmapRectView2; }
250 static SkViewRegister gR0(F0); 250 static SkViewRegister gR0(F0);
251 static SkViewRegister gR1(F1); 251 static SkViewRegister gR1(F1);
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleCamera.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698