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

Side by Side Diff: gm/bleed.cpp

Issue 73643005: Implement a benchmark for GrResourceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address comments Created 7 years, 1 month 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 | « bench/benchmain.cpp ('k') | gm/gm.h » ('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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 this->drawCase3(canvas, kCol1X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kLow_FilterLevel); 194 this->drawCase3(canvas, kCol1X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kLow_FilterLevel);
195 this->drawCase4(canvas, kCol1X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kLow_FilterLevel); 195 this->drawCase4(canvas, kCol1X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kLow_FilterLevel);
196 196
197 // Then draw a column with no bleeding or tiling but with high filtering 197 // Then draw a column with no bleeding or tiling but with high filtering
198 this->drawCase1(canvas, kCol2X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel); 198 this->drawCase1(canvas, kCol2X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel);
199 this->drawCase2(canvas, kCol2X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel); 199 this->drawCase2(canvas, kCol2X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel);
200 this->drawCase3(canvas, kCol2X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel); 200 this->drawCase3(canvas, kCol2X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel);
201 this->drawCase4(canvas, kCol2X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel); 201 this->drawCase4(canvas, kCol2X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kHigh_FilterLevel);
202 202
203 #if SK_SUPPORT_GPU 203 #if SK_SUPPORT_GPU
204 GrContext* ctx = GM::GetGr(canvas); 204 GrContext* ctx = canvas->getGrContext();
205 int oldMaxTextureSize = 0; 205 int oldMaxTextureSize = 0;
206 if (NULL != ctx) { 206 if (NULL != ctx) {
207 // shrink the max texture size so all our textures can be reasonably sized 207 // shrink the max texture size so all our textures can be reasonably sized
208 oldMaxTextureSize = ctx->getMaxTextureSize(); 208 oldMaxTextureSize = ctx->getMaxTextureSize();
209 ctx->setMaxTextureSizeOverride(kMaxTextureSize); 209 ctx->setMaxTextureSizeOverride(kMaxTextureSize);
210 } 210 }
211 #endif 211 #endif
212 212
213 // Then draw a column with no bleeding but with tiling and low filtering 213 // Then draw a column with no bleeding but with tiling and low filtering
214 this->drawCase1(canvas, kCol3X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kLow_FilterLevel); 214 this->drawCase1(canvas, kCol3X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFl ag, SkPaint::kLow_FilterLevel);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 static const int kSmallTextureSize = 6; 263 static const int kSmallTextureSize = 6;
264 static const int kMaxTextureSize = 32; 264 static const int kMaxTextureSize = 32;
265 265
266 SkBitmap fBitmapSmall; 266 SkBitmap fBitmapSmall;
267 SkBitmap fBitmapBig; 267 SkBitmap fBitmapBig;
268 268
269 typedef GM INHERITED; 269 typedef GM INHERITED;
270 }; 270 };
271 271
272 DEF_GM( return new BleedGM(); ) 272 DEF_GM( return new BleedGM(); )
OLDNEW
« no previous file with comments | « bench/benchmain.cpp ('k') | gm/gm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698