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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrDrawTargetCaps.h » ('j') | tests/GrDrawTargetTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 9397d1488f9ada1ff7633eac300d7e3f741bac04..6a1c4544b9a19656bded514f296333dc421c700e 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -1008,23 +1008,24 @@ GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) {
return *this;
}
-void GrDrawTargetCaps::print() const {
+SkString GrDrawTargetCaps::dump() const {
+ SkString r;
static const char* gNY[] = {"NO", "YES"};
- GrPrintf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]);
- GrPrintf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport]);
- GrPrintf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport]);
- GrPrintf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport]);
- GrPrintf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]);
- GrPrintf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport]);
- GrPrintf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]);
- GrPrintf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSupport]);
- GrPrintf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]);
- GrPrintf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]);
- GrPrintf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]);
- GrPrintf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]);
- GrPrintf("Max Texture Size : %d\n", fMaxTextureSize);
- GrPrintf("Max Render Target Size : %d\n", fMaxRenderTargetSize);
- GrPrintf("Max Sample Count : %d\n", fMaxSampleCount);
+ r.appendf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]);
+ r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport]);
+ r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport]);
+ r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport]);
+ r.appendf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]);
+ r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport]);
+ r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]);
+ r.appendf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSupport]);
+ r.appendf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]);
+ r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]);
+ r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]);
+ r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]);
+ r.appendf("Max Texture Size : %d\n", fMaxTextureSize);
+ r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize);
+ r.appendf("Max Sample Count : %d\n", fMaxSampleCount);
static const char* kConfigNames[] = {
"Unknown", // kUnknown_GrPixelConfig
@@ -1048,10 +1049,11 @@ void GrDrawTargetCaps::print() const {
SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]);
for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) {
if (i != kUnknown_GrPixelConfig) {
- GrPrintf("%s is renderable: %s, with MSAA: %s\n",
+ r.appendf("%s is renderable: %s, with MSAA: %s\n",
kConfigNames[i],
gNY[fConfigRenderSupport[i][0]],
gNY[fConfigRenderSupport[i][1]]);
}
}
+ return r;
}
« 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