Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Custom layer fixes #11239

Merged
merged 5 commits into from
Feb 23, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/mbgl/renderer/layers/render_custom_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <mbgl/renderer/bucket.hpp>
#include <mbgl/style/layers/custom_layer_impl.hpp>
#include <mbgl/map/transform_state.hpp>
#include <mbgl/gl/gl.hpp>

namespace mbgl {

Expand Down Expand Up @@ -46,11 +47,11 @@ void RenderCustomLayer::render(PaintParameters& paintParameters, RenderSource*)
if (context != impl().context || !initialized) {
//If the context changed, deinitialize the previous one before initializing the new one.
if (context && !contextDestroyed && impl().deinitializeFn) {
impl().deinitializeFn(context);
MBGL_CHECK_ERROR(impl().deinitializeFn(context));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to break on Qt due to the special use of MBGL_CHECK_ERROR there? (#11106)

cc @kkaefer @tmpsantos

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, Qt is not using MBGL_CHECK_ERROR as described by #11106

}
context = impl().context;
assert(impl().initializeFn);
impl().initializeFn(impl().context);
MBGL_CHECK_ERROR(impl().initializeFn(impl().context));
initialized = true;
}

Expand All @@ -75,7 +76,7 @@ void RenderCustomLayer::render(PaintParameters& paintParameters, RenderSource*)
parameters.fieldOfView = state.getFieldOfView();

assert(impl().renderFn);
impl().renderFn(context, parameters);
MBGL_CHECK_ERROR(impl().renderFn(context, parameters));

// Reset the view back to our original one, just in case the CustomLayer changed
// the viewport or Framebuffer.
Expand Down