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

Side by Side Diff: src/gpu/GrDrawTarget.cpp

Issue 72353003: Avoid printing draw target info to stderr while running unit tests (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/gpu/GrDrawTargetCaps.h » ('j') | tests/GrDrawTargetTest.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 1001
1002 fMaxRenderTargetSize = other.fMaxRenderTargetSize; 1002 fMaxRenderTargetSize = other.fMaxRenderTargetSize;
1003 fMaxTextureSize = other.fMaxTextureSize; 1003 fMaxTextureSize = other.fMaxTextureSize;
1004 fMaxSampleCount = other.fMaxSampleCount; 1004 fMaxSampleCount = other.fMaxSampleCount;
1005 1005
1006 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende rSupport)); 1006 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende rSupport));
1007 1007
1008 return *this; 1008 return *this;
1009 } 1009 }
1010 1010
1011 void GrDrawTargetCaps::print() const { 1011 SkString GrDrawTargetCaps::dump() const {
1012 SkString r;
1012 static const char* gNY[] = {"NO", "YES"}; 1013 static const char* gNY[] = {"NO", "YES"};
1013 GrPrintf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]); 1014 r.appendf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]);
1014 GrPrintf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport]) ; 1015 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport] );
1015 GrPrintf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport]) ; 1016 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport] );
1016 GrPrintf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport]); 1017 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport]) ;
1017 GrPrintf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]); 1018 r.appendf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]);
1018 GrPrintf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport] ); 1019 r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport ]);
1019 GrPrintf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]); 1020 r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]) ;
1020 GrPrintf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSuppor t]); 1021 r.appendf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSuppo rt]);
1021 GrPrintf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]); 1022 r.appendf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]);
1022 GrPrintf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]); 1023 r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]);
1023 GrPrintf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]) ; 1024 r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport] );
1024 GrPrintf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]); 1025 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]);
1025 GrPrintf("Max Texture Size : %d\n", fMaxTextureSize); 1026 r.appendf("Max Texture Size : %d\n", fMaxTextureSize);
1026 GrPrintf("Max Render Target Size : %d\n", fMaxRenderTargetSize); 1027 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize);
1027 GrPrintf("Max Sample Count : %d\n", fMaxSampleCount); 1028 r.appendf("Max Sample Count : %d\n", fMaxSampleCount);
1028 1029
1029 static const char* kConfigNames[] = { 1030 static const char* kConfigNames[] = {
1030 "Unknown", // kUnknown_GrPixelConfig 1031 "Unknown", // kUnknown_GrPixelConfig
1031 "Alpha8", // kAlpha_8_GrPixelConfig, 1032 "Alpha8", // kAlpha_8_GrPixelConfig,
1032 "Index8", // kIndex_8_GrPixelConfig, 1033 "Index8", // kIndex_8_GrPixelConfig,
1033 "RGB565", // kRGB_565_GrPixelConfig, 1034 "RGB565", // kRGB_565_GrPixelConfig,
1034 "RGBA444", // kRGBA_4444_GrPixelConfig, 1035 "RGBA444", // kRGBA_4444_GrPixelConfig,
1035 "RGBA8888", // kRGBA_8888_GrPixelConfig, 1036 "RGBA8888", // kRGBA_8888_GrPixelConfig,
1036 "BGRA8888", // kBGRA_8888_GrPixelConfig, 1037 "BGRA8888", // kBGRA_8888_GrPixelConfig,
1037 }; 1038 };
1038 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); 1039 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig);
1039 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); 1040 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig);
1040 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); 1041 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig);
1041 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); 1042 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig);
1042 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); 1043 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig);
1043 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); 1044 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig);
1044 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); 1045 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig);
1045 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt); 1046 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt);
1046 1047
1047 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]); 1048 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]);
1048 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]); 1049 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]);
1049 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { 1050 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) {
1050 if (i != kUnknown_GrPixelConfig) { 1051 if (i != kUnknown_GrPixelConfig) {
1051 GrPrintf("%s is renderable: %s, with MSAA: %s\n", 1052 r.appendf("%s is renderable: %s, with MSAA: %s\n",
1052 kConfigNames[i], 1053 kConfigNames[i],
1053 gNY[fConfigRenderSupport[i][0]], 1054 gNY[fConfigRenderSupport[i][0]],
1054 gNY[fConfigRenderSupport[i][1]]); 1055 gNY[fConfigRenderSupport[i][1]]);
1055 } 1056 }
1056 } 1057 }
1058 return r;
1057 } 1059 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDrawTargetCaps.h » ('j') | tests/GrDrawTargetTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698