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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 scanline = (PIXEL_TYPE*)((char*)scanline + rowBytes); | 229 scanline = (PIXEL_TYPE*)((char*)scanline + rowBytes); |
230 for (int x = 0; x < width + kXPad; ++x) { | 230 for (int x = 0; x < width + kXPad; ++x) { |
231 scanline[x] = padColor; | 231 scanline[x] = padColor; |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 GrSurfaceDesc desc; | 235 GrSurfaceDesc desc; |
236 desc.fConfig = config; | 236 desc.fConfig = config; |
237 desc.fWidth = width + kXPad; | 237 desc.fWidth = width + kXPad; |
238 desc.fHeight = height + kYPad; | 238 desc.fHeight = height + kYPad; |
239 SkAutoTUnref<GrTexture> texture(ctx->textureProvider()->createTexture( | 239 SkAutoTUnref<GrTexture> texture(ctx->textureProvider()->createTexture(desc,
true, pixels.get(), |
240 desc, SkBudgeted::kYes, pixels.get(), rowBytes)); | 240 rowByt
es)); |
241 | 241 |
242 if (!texture) { | 242 if (!texture) { |
243 return false; | 243 return false; |
244 } | 244 } |
245 | 245 |
246 GrWrapTextureInBitmap(texture, width, height, true, &result->fBitmap); | 246 GrWrapTextureInBitmap(texture, width, height, true, &result->fBitmap); |
247 result->fType = TestPixels::kBitmap; | 247 result->fType = TestPixels::kBitmap; |
248 result->fBitmap.setImmutable(); | 248 result->fBitmap.setImmutable(); |
249 result->fRect.set(2, 2, width, height); | 249 result->fRect.set(2, 2, width, height); |
250 return true; | 250 return true; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 | 596 |
597 DEF_GM( return new BleedGM(kUseBitmap_BleedTest); ) | 597 DEF_GM( return new BleedGM(kUseBitmap_BleedTest); ) |
598 DEF_GM( return new BleedGM(kUseTextureBitmap_BleedTest); ) | 598 DEF_GM( return new BleedGM(kUseTextureBitmap_BleedTest); ) |
599 DEF_GM( return new BleedGM(kUseImage_BleedTest); ) | 599 DEF_GM( return new BleedGM(kUseImage_BleedTest); ) |
600 DEF_GM( return new BleedGM(kUseAlphaBitmap_BleedTest); ) | 600 DEF_GM( return new BleedGM(kUseAlphaBitmap_BleedTest); ) |
601 DEF_GM( return new BleedGM(kUseAlphaTextureBitmap_BleedTest); ) | 601 DEF_GM( return new BleedGM(kUseAlphaTextureBitmap_BleedTest); ) |
602 DEF_GM( return new BleedGM(kUseAlphaImage_BleedTest); ) | 602 DEF_GM( return new BleedGM(kUseAlphaImage_BleedTest); ) |
603 DEF_GM( return new BleedGM(kUseAlphaBitmapShader_BleedTest); ) | 603 DEF_GM( return new BleedGM(kUseAlphaBitmapShader_BleedTest); ) |
604 DEF_GM( return new BleedGM(kUseAlphaTextureBitmapShader_BleedTest); ) | 604 DEF_GM( return new BleedGM(kUseAlphaTextureBitmapShader_BleedTest); ) |
605 DEF_GM( return new BleedGM(kUseAlphaImageShader_BleedTest); ) | 605 DEF_GM( return new BleedGM(kUseAlphaImageShader_BleedTest); ) |
OLD | NEW |