aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-20 15:34:05 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-20 21:10:56 +0000
commit5ec9def2dd7bba572398ff2aa9361fbbb3b478ed (patch)
tree8e6105038fca868682ddf3a8306dce11b2e075ae /src/gpu/text
parent8c5bad35f5d98040f2db2ffd3ba9a924c7436784 (diff)
Rename files, macros, types, and functions related to GrDrawOp testing.
Make the test factories use sk_sp. Change-Id: Idba630b84deb2848f2203a80fd72e1efa5fc6acf Reviewed-on: https://skia-review.googlesource.com/6342 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp23
-rw-r--r--src/gpu/text/GrAtlasTextContext.h8
2 files changed, 13 insertions, 18 deletions
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 032a9839d6..e1a3675d40 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -376,7 +376,7 @@ void GrAtlasTextContext::drawPosText(GrContext* context,
#ifdef GR_TEST_UTILS
-DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
+DRAW_OP_TEST_DEFINE(TextBlobOp) {
static uint32_t gContextID = SK_InvalidGenID;
static GrAtlasTextContext* gTextContext = nullptr;
static SkSurfaceProps gSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
@@ -419,19 +419,14 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
// right now we don't handle textblobs, nor do we handle drawPosText. Since we only
// intend to test the batch with this unit test, that is okay.
- sk_sp<GrAtlasTextBlob> blob(
- GrAtlasTextContext::CreateDrawTextBlob(context->getTextBlobCache(),
- context->getAtlasGlyphCache(),
- *context->caps()->shaderCaps(), grPaint, skPaint,
- GrAtlasTextContext::kTextBlobBatchScalerContextFlags,
- viewMatrix,
- gSurfaceProps, text,
- static_cast<size_t>(textLen), x, y));
-
- return blob
- ->test_makeOp(textLen, 0, 0, viewMatrix, x, y, color, skPaint, gSurfaceProps,
- gTextContext->dfAdjustTable(), context->getAtlasGlyphCache())
- .release();
+ sk_sp<GrAtlasTextBlob> blob(GrAtlasTextContext::CreateDrawTextBlob(
+ context->getTextBlobCache(), context->getAtlasGlyphCache(),
+ *context->caps()->shaderCaps(), grPaint, skPaint,
+ GrAtlasTextContext::kTextBlobOpScalerContextFlags, viewMatrix, gSurfaceProps, text,
+ static_cast<size_t>(textLen), x, y));
+
+ return blob->test_makeOp(textLen, 0, 0, viewMatrix, x, y, color, skPaint, gSurfaceProps,
+ gTextContext->dfAdjustTable(), context->getAtlasGlyphCache());
}
#endif
diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h
index 471d9d2014..0417935ea7 100644
--- a/src/gpu/text/GrAtlasTextContext.h
+++ b/src/gpu/text/GrAtlasTextContext.h
@@ -14,7 +14,7 @@
#include "SkTextBlobRunIterator.h"
#ifdef GR_TEST_UTILS
-#include "GrBatchTest.h"
+#include "GrDrawOpTest.h"
#endif
class GrDrawOp;
@@ -89,9 +89,9 @@ private:
sk_sp<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
#ifdef GR_TEST_UTILS
- static const uint32_t kTextBlobBatchScalerContextFlags =
- SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags;
- DRAW_BATCH_TEST_FRIEND(TextBlobBatch);
+ static const uint32_t kTextBlobOpScalerContextFlags =
+ SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags;
+ DRAW_OP_TEST_FRIEND(TextBlobOp);
#endif
};