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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(desc,
true, pixels.get(), | 239 SkAutoTUnref<GrTexture> texture(ctx->textureProvider()->createTexture(desc,
true, pixels.get(), |
240 rowByt
es)); | 240 rowByt
es)); |
241 | 241 |
242 if (!texture) { | 242 if (!texture) { |
243 return false; | 243 return false; |
244 } | 244 } |
245 | 245 |
| 246 texture->setFromRawPixels(true); |
| 247 texture->setException(true); |
| 248 |
246 GrWrapTextureInBitmap(texture, width, height, true, &result->fBitmap); | 249 GrWrapTextureInBitmap(texture, width, height, true, &result->fBitmap); |
247 result->fType = TestPixels::kBitmap; | 250 result->fType = TestPixels::kBitmap; |
248 result->fBitmap.setImmutable(); | 251 result->fBitmap.setImmutable(); |
249 result->fRect.set(2, 2, width, height); | 252 result->fRect.set(2, 2, width, height); |
250 return true; | 253 return true; |
251 #else | 254 #else |
252 return false; | 255 return false; |
253 #endif | 256 #endif |
254 } | 257 } |
255 | 258 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 | 599 |
597 DEF_GM( return new BleedGM(kUseBitmap_BleedTest); ) | 600 DEF_GM( return new BleedGM(kUseBitmap_BleedTest); ) |
598 DEF_GM( return new BleedGM(kUseTextureBitmap_BleedTest); ) | 601 DEF_GM( return new BleedGM(kUseTextureBitmap_BleedTest); ) |
599 DEF_GM( return new BleedGM(kUseImage_BleedTest); ) | 602 DEF_GM( return new BleedGM(kUseImage_BleedTest); ) |
600 DEF_GM( return new BleedGM(kUseAlphaBitmap_BleedTest); ) | 603 DEF_GM( return new BleedGM(kUseAlphaBitmap_BleedTest); ) |
601 DEF_GM( return new BleedGM(kUseAlphaTextureBitmap_BleedTest); ) | 604 DEF_GM( return new BleedGM(kUseAlphaTextureBitmap_BleedTest); ) |
602 DEF_GM( return new BleedGM(kUseAlphaImage_BleedTest); ) | 605 DEF_GM( return new BleedGM(kUseAlphaImage_BleedTest); ) |
603 DEF_GM( return new BleedGM(kUseAlphaBitmapShader_BleedTest); ) | 606 DEF_GM( return new BleedGM(kUseAlphaBitmapShader_BleedTest); ) |
604 DEF_GM( return new BleedGM(kUseAlphaTextureBitmapShader_BleedTest); ) | 607 DEF_GM( return new BleedGM(kUseAlphaTextureBitmapShader_BleedTest); ) |
605 DEF_GM( return new BleedGM(kUseAlphaImageShader_BleedTest); ) | 608 DEF_GM( return new BleedGM(kUseAlphaImageShader_BleedTest); ) |
OLD | NEW |