#include <GrDrawOpAtlas.h>
Definition at line 250 of file GrDrawOpAtlas.h.
◆ GrDrawOpAtlasConfig() [1/2]
GrDrawOpAtlasConfig::GrDrawOpAtlasConfig |
( |
int |
maxTextureSize, |
|
|
size_t |
maxBytes |
|
) |
| |
Definition at line 559 of file GrDrawOpAtlas.cpp.
559 {
560 static const SkISize kARGBDimensions[] = {
561 {256, 256},
562 {512, 256},
563 {512, 512},
564 {1024, 512},
565 {1024, 1024},
566 {2048, 1024},
567 };
568
569
570 maxBytes >>= 18;
571
572 int index = maxBytes > 0
573 ? SkTPin<int>(
SkPrevLog2(maxBytes), 0, std::size(kARGBDimensions) - 1)
574 : 0;
575
578 fARGBDimensions.
set(std::min<int>(kARGBDimensions[index].
width(), maxTextureSize),
579 std::min<int>(kARGBDimensions[index].
height(), maxTextureSize));
580 fMaxTextureSize = std::min<int>(maxTextureSize, kMaxAtlasDim);
581}
static int SkPrevLog2(uint32_t value)
void set(int32_t w, int32_t h)
◆ GrDrawOpAtlasConfig() [2/2]
GrDrawOpAtlasConfig::GrDrawOpAtlasConfig |
( |
| ) |
|
|
inline |
◆ atlasDimensions()
Definition at line 583 of file GrDrawOpAtlas.cpp.
583 {
584 if (MaskFormat::kA8 ==
type) {
585
586 return { std::min<int>(2 * fARGBDimensions.
width(), fMaxTextureSize),
587 std::min<int>(2 * fARGBDimensions.
height(), fMaxTextureSize) };
588 } else {
589 return fARGBDimensions;
590 }
591}
constexpr int32_t width() const
constexpr int32_t height() const
◆ plotDimensions()
Definition at line 593 of file GrDrawOpAtlas.cpp.
593 {
594 if (MaskFormat::kA8 ==
type) {
596
597
598
599
600
601
604
605 return { plotWidth, plotHeight };
606 } else {
607
608 return { 256, 256 };
609 }
610}
SkISize atlasDimensions(skgpu::MaskFormat type) const
The documentation for this class was generated from the following files: