Revert "Tweak Plot size to try to get better perf."
This reverts commit fdcbe206f52a95eed5f97cc47d2a0801a4a7ee8e.
Reason for revert: Produced a further perf regression.
Original change's description:
> Tweak Plot size to try to get better perf.
>
> Large plots allow tighter packing of large glyphs, but smaller plots
> take less time to update. Trying a size in between for the largest
> A8 size.
>
> Bug: skia:8642
> Change-Id: Ib6d7651b70fe3a2101a3bfc5b367c433123cb914
> Reviewed-on: https://skia-review.googlesource.com/c/179242
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=jvanverth@google.com,robertphillips@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:8642
Change-Id: I9bc32abfae1fb4a6380b2fd5c0a1ea269447c534
Reviewed-on: https://skia-review.googlesource.com/c/179726
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 6a2dc7c..94afadc 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -640,9 +640,10 @@
// larger SDF glyphs. Since the largest SDF glyph can be 170x170 with padding, this
// allows us to pack 3 in a 512x256 plot, or 9 in a 512x512 plot.
- // This will give us 512x256 plots for 2048x1024 and 2048x2048, and 256x256 plots otherwise.
+ // This will give us 512x256 plots for 2048x1024, 512x512 plots for 2048x2048,
+ // and 256x256 plots otherwise.
int plotWidth = atlasDimensions.width() >= 2048 ? 512 : 256;
- int plotHeight = 256;
+ int plotHeight = atlasDimensions.height() >= 2048 ? 512 : 256;
return { plotWidth, plotHeight };
} else {
diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp
index b1d30ac..52fd9c0 100644
--- a/tests/DrawOpAtlasTest.cpp
+++ b/tests/DrawOpAtlasTest.cpp
@@ -266,17 +266,17 @@
test_atlas_config(reporter, 65536, 4 * 1024 * 1024, kARGB_GrMaskFormat,
{ 1024, 1024 }, { 256, 256 });
test_atlas_config(reporter, 65536, 4 * 1024 * 1024, kA8_GrMaskFormat,
- { 2048, 2048 }, { 512, 256 });
+ { 2048, 2048 }, { 512, 512 });
// 8 MB
test_atlas_config(reporter, 65536, 8 * 1024 * 1024, kARGB_GrMaskFormat,
{ 2048, 1024 }, { 256, 256 });
test_atlas_config(reporter, 65536, 8 * 1024 * 1024, kA8_GrMaskFormat,
- { 2048, 2048 }, { 512, 256 });
+ { 2048, 2048 }, { 512, 512 });
// 16 MB (should be same as 8 MB)
test_atlas_config(reporter, 65536, 16 * 1024 * 1024, kARGB_GrMaskFormat,
{ 2048, 1024 }, { 256, 256 });
test_atlas_config(reporter, 65536, 16 * 1024 * 1024, kA8_GrMaskFormat,
- { 2048, 2048 }, { 512, 256 });
+ { 2048, 2048 }, { 512, 512 });
// 4MB, restricted texture size
test_atlas_config(reporter, 1024, 8 * 1024 * 1024, kARGB_GrMaskFormat,