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

Unified Diff: tests/TextBlobCacheTest.cpp

Issue 1250003003: Fix up textblobcachetest (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: windows warnings Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TextBlobCacheTest.cpp
diff --git a/tests/TextBlobCacheTest.cpp b/tests/TextBlobCacheTest.cpp
index b15af9083ab7dd36214a00c60ad2e877e04aaab1..1c6596258b5b4bd34f1aec39a295ec14169592a3 100644
--- a/tests/TextBlobCacheTest.cpp
+++ b/tests/TextBlobCacheTest.cpp
@@ -32,10 +32,14 @@ struct TextBlobWrapper {
};
static void draw(SkCanvas* canvas, int redraw, const SkTArray<TextBlobWrapper>& blobs) {
+ int yOffset = 0;
for (int r = 0; r < redraw; r++) {
for (int i = 0; i < blobs.count(); i++) {
+ const SkTextBlob* blob = blobs[i].fBlob.get();
+ const SkRect& bounds = blob->bounds();
+ yOffset += SkScalarCeilToInt(bounds.height());
SkPaint paint;
- canvas->drawTextBlob(blobs[i].fBlob.get(), 0, 0, paint);
+ canvas->drawTextBlob(blob, 0, SkIntToScalar(yOffset), paint);
}
}
}
@@ -46,14 +50,12 @@ static void draw(SkCanvas* canvas, int redraw, const SkTArray<TextBlobWrapper>&
#define MAX_FAMILIES 5
// This test hammers the GPU textblobcache and font atlas
-DEF_TEST(TextBlobCache, reporter) {
- SkAutoTDelete<GrContextFactory> grFactory(SkNEW(GrContextFactory));
-
+DEF_GPUTEST(TextBlobCache, reporter, factory) {
// setup surface
uint32_t flags = 0;
SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
- GrContext* ctx = grFactory->get(GrContextFactory::kNative_GLContextType);
+ GrContext* ctx = factory->get(GrContextFactory::kNative_GLContextType);
SkImageInfo info = SkImageInfo::Make(1024, 768, kN32_SkColorType, kPremul_SkAlphaType);
SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, SkSurface::kNo_Budgeted, info,
0, &props));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698