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

Unified Diff: src/gpu/GrTest.cpp

Issue 1300813007: wire up reduced atlas and zero textblob cache to test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 4 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 | « src/gpu/GrTest.h ('k') | src/gpu/GrTextBlobCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTest.cpp
diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp
index a2efb4829beee513b07ff84a46dcdc655e16aa50..2b03238ab4f9a3384b460948b67b59de0851cf17 100644
--- a/src/gpu/GrTest.cpp
+++ b/src/gpu/GrTest.cpp
@@ -8,6 +8,7 @@
#include "GrTest.h"
+#include "GrBatchAtlas.h"
#include "GrBatchFontCache.h"
#include "GrBufferedDrawTarget.h"
#include "GrContextOptions.h"
@@ -16,6 +17,31 @@
#include "GrTextBlobCache.h"
#include "SkString.h"
+namespace GrTest {
+void SetupAlwaysEvictAtlas(GrContext* context) {
+ // These sizes were selected because they allow each atlas to hold a single plot and will thus
+ // stress the atlas
+ int dim = GrBatchAtlas::kGlyphMaxDim;
+ GrBatchAtlasConfig configs[3];
+ configs[kA8_GrMaskFormat].fWidth = dim;
+ configs[kA8_GrMaskFormat].fHeight = dim;
+ configs[kA8_GrMaskFormat].fPlotWidth = dim;
+ configs[kA8_GrMaskFormat].fPlotHeight = dim;
+
+ configs[kA565_GrMaskFormat].fWidth = dim;
+ configs[kA565_GrMaskFormat].fHeight = dim;
+ configs[kA565_GrMaskFormat].fPlotWidth = dim;
+ configs[kA565_GrMaskFormat].fPlotHeight = dim;
+
+ configs[kARGB_GrMaskFormat].fWidth = dim;
+ configs[kARGB_GrMaskFormat].fHeight = dim;
+ configs[kARGB_GrMaskFormat].fPlotWidth = dim;
+ configs[kARGB_GrMaskFormat].fPlotHeight = dim;
+
+ context->setTextContextAtlasSizes_ForTesting(configs);
+}
+};
+
void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target) {
SkASSERT(!fContext);
« no previous file with comments | « src/gpu/GrTest.h ('k') | src/gpu/GrTextBlobCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698