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

Side by Side Diff: tests/BitmapCopyTest.cpp

Issue 1966013002: Turn ContextInfos returned by GrContextFactory into structs. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Address comment Created 4 years, 7 months 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
« no previous file with comments | « tests/ApplyGammaTest.cpp ('k') | tests/BlurTest.cpp » ('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 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
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 ctxInfo.fGrContext->textureProvider()->createTexture(desc, SkBud geted::kNo, srcData, 670 ctxInfo.grContext()->textureProvider()->createTexture(desc, SkBu dgeted::kNo,
671 0)); 671 srcData, 0 ));
672 672
673 if (!texture) { 673 if (!texture) {
674 continue; 674 continue;
675 } 675 }
676 676
677 SkBitmap srcBmp; 677 SkBitmap srcBmp;
678 GrWrapTextureInBitmap(texture, 2, 2, false, &srcBmp); 678 GrWrapTextureInBitmap(texture, 2, 2, false, &srcBmp);
679 if (srcBmp.isNull()) { 679 if (srcBmp.isNull()) {
680 ERRORF(reporter, "Could not wrap texture in bitmap."); 680 ERRORF(reporter, "Could not wrap texture in bitmap.");
681 continue; 681 continue;
(...skipping 28 matching lines...) Expand all
710 } 710 }
711 } 711 }
712 dstBmpPixels += dstBmp.rowBytes(); 712 dstBmpPixels += dstBmp.rowBytes();
713 } 713 }
714 } 714 }
715 } 715 }
716 } 716 }
717 } 717 }
718 718
719 #endif 719 #endif
OLDNEW
« no previous file with comments | « tests/ApplyGammaTest.cpp ('k') | tests/BlurTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698