Drawable LayerGroup sorting, depth buffer, split view (#1173)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
mwilsnd
2023-05-25 15:32:21 -05:00
committed by Bart Louwers
parent 1c8304a609
commit f63fa49152
17 changed files with 244 additions and 89 deletions

View File

@@ -75,16 +75,10 @@ bool RenderBackgroundLayer::hasCrossfade() const {
return getCrossfade<BackgroundLayerProperties>(evaluatedProperties).t != 1;
}
static bool enableDefaultRender = false;
void RenderBackgroundLayer::render(PaintParameters& parameters) {
// Note that for bottommost layers without a pattern, the background color
// is drawn with glClear rather than this method.
if (!enableDefaultRender) {
return;
}
// Ensure programs are available
if (!parameters.shaders.populate(backgroundProgram)) return;
if (!parameters.shaders.populate(backgroundPatternProgram)) return;
@@ -181,8 +175,7 @@ std::optional<Color> RenderBackgroundLayer::getSolidBackground() const {
return std::nullopt;
}
return std::nullopt;
// return { evaluated.get<BackgroundColor>() * evaluated.get<BackgroundOpacity>() };
return {evaluated.get<BackgroundColor>() * evaluated.get<BackgroundOpacity>()};
}
namespace {
@@ -213,15 +206,11 @@ void RenderBackgroundLayer::layerRemoved(UniqueChangeRequestVec& changes) {
}
}
void RenderBackgroundLayer::update(const int32_t layerIndex,
gfx::ShaderRegistry& shaders,
void RenderBackgroundLayer::update(gfx::ShaderRegistry& shaders,
gfx::Context& context,
const TransformState& state,
UniqueChangeRequestVec& changes) {
if (enableDefaultRender) {
return;
}
[[maybe_unused]] const RenderTree& renderTree,
[[maybe_unused]] UniqueChangeRequestVec& changes) {
std::unique_lock<std::mutex> guard(mutex);
if (!shader) {
@@ -271,7 +260,6 @@ void RenderBackgroundLayer::update(const int32_t layerIndex,
return;
}
tileLayerGroup->setLayerTweaker(std::make_shared<BackgroundLayerTweaker>(evaluatedProperties));
changes.emplace_back(std::make_unique<AddLayerGroupRequest>(tileLayerGroup, /*canReplace=*/true));
}
// Drawables per overscaled or canonical tile?