| OLD | NEW |
| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkRect.h" | 9 #include "SkRect.h" |
| 10 #include "SkTemplates.h" | 10 #include "SkTemplates.h" |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 GrSurfaceDesc desc; | 660 GrSurfaceDesc desc; |
| 661 desc.fConfig = kSrcConfigs[srcC]; | 661 desc.fConfig = kSrcConfigs[srcC]; |
| 662 desc.fFlags = rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlag
s; | 662 desc.fFlags = rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlag
s; |
| 663 desc.fWidth = 2; | 663 desc.fWidth = 2; |
| 664 desc.fHeight = 2; | 664 desc.fHeight = 2; |
| 665 desc.fOrigin = kTopLeft_GrSurfaceOrigin; | 665 desc.fOrigin = kTopLeft_GrSurfaceOrigin; |
| 666 | 666 |
| 667 const void* srcData = (kSkia8888_GrPixelConfig == desc.fConfig) ? kD
ata : swizData; | 667 const void* srcData = (kSkia8888_GrPixelConfig == desc.fConfig) ? kD
ata : swizData; |
| 668 | 668 |
| 669 SkAutoTUnref<GrTexture> texture( | 669 SkAutoTUnref<GrTexture> texture( |
| 670 ctx->textureProvider()->createTexture(desc, SkBudgeted::kNo, src
Data, 0)); | 670 ctx->textureProvider()->createTexture(desc, false, srcData, 0)); |
| 671 | 671 |
| 672 if (!texture) { | 672 if (!texture) { |
| 673 continue; | 673 continue; |
| 674 } | 674 } |
| 675 | 675 |
| 676 SkBitmap srcBmp; | 676 SkBitmap srcBmp; |
| 677 GrWrapTextureInBitmap(texture, 2, 2, false, &srcBmp); | 677 GrWrapTextureInBitmap(texture, 2, 2, false, &srcBmp); |
| 678 if (srcBmp.isNull()) { | 678 if (srcBmp.isNull()) { |
| 679 ERRORF(reporter, "Could not wrap texture in bitmap."); | 679 ERRORF(reporter, "Could not wrap texture in bitmap."); |
| 680 continue; | 680 continue; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 709 } | 709 } |
| 710 } | 710 } |
| 711 dstBmpPixels += dstBmp.rowBytes(); | 711 dstBmpPixels += dstBmp.rowBytes(); |
| 712 } | 712 } |
| 713 } | 713 } |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 | 717 |
| 718 #endif | 718 #endif |
| OLD | NEW |