OLD | NEW |
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 Loading... |
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 Loading... |
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(); ) |
OLD | NEW |