-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
Avoids problems on (amongst others) Samsung Galaxy J3
@@ -2,11 +2,114 @@ | |||
#include <GLES2/gl2.h> | |||
|
|||
#include <mbgl/util/logging.hpp> | |||
|
|||
#include <mbgl/util/string.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably remove the logging.hpp
and string.hpp
dependencies. I don't think we should encourage custom layer implementations to depend on anything other than custom_layer.hpp
.
@@ -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)); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
…and string headers
@jfirebaugh Removed the dependencies on mbgl headers, expect for the custom layer specific. |
Fixes #8448
Fixes two issues reported in #8448:
The issues where obscured by the fact that we don't have error checking in the custom layer functions (as it is external code). Any subsequent opengl operation would fail, hinting at unrelated points in the code. This pr adds some checks on calling into the custom layer code to render_custom_layer to makes sure these things are easier to catch.
Also added error checking code to the example custom layer to make debugging easier in the future.