#include <DrawAtlas.h>
Definition at line 256 of file DrawAtlas.h.
◆ DrawAtlasConfig()
skgpu::graphite::DrawAtlasConfig::DrawAtlasConfig |
( |
int |
maxTextureSize, |
|
|
size_t |
maxBytes |
|
) |
| |
Definition at line 516 of file DrawAtlas.cpp.
516 {
517 static const SkISize kARGBDimensions[] = {
518 {256, 256},
519 {512, 256},
520 {512, 512},
521 {1024, 512},
522 {1024, 1024},
523 {2048, 1024},
524 };
525
526
527 maxBytes >>= 18;
528
529 int index = maxBytes > 0
530 ? SkTPin<int>(
SkPrevLog2(maxBytes), 0, std::size(kARGBDimensions) - 1)
531 : 0;
532
535 fARGBDimensions.
set(std::min<int>(kARGBDimensions[index].
width(), maxTextureSize),
536 std::min<int>(kARGBDimensions[index].
height(), maxTextureSize));
537 fMaxTextureSize = std::min<int>(maxTextureSize, kMaxAtlasDim);
538}
static int SkPrevLog2(uint32_t value)
void set(int32_t w, int32_t h)
◆ atlasDimensions()
Definition at line 540 of file DrawAtlas.cpp.
540 {
541 if (MaskFormat::kA8 ==
type) {
542
543 return { std::min<int>(2 * fARGBDimensions.
width(), fMaxTextureSize),
544 std::min<int>(2 * fARGBDimensions.
height(), fMaxTextureSize) };
545 } else {
546 return fARGBDimensions;
547 }
548}
constexpr int32_t width() const
constexpr int32_t height() const
◆ plotDimensions()
Definition at line 550 of file DrawAtlas.cpp.
550 {
551 if (MaskFormat::kA8 ==
type) {
553
554
555
556
557
558
561
562 return { plotWidth, plotHeight };
563 } else {
564
565 return { 256, 256 };
566 }
567}
SkISize atlasDimensions(MaskFormat type) const
The documentation for this class was generated from the following files: