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

[DO NOT MERGE] expose NodeView to JavaScript - #2310

Closed
mikemorris wants to merge 2 commits into
masterfrom
node-view
Closed

mikemorris wants to merge 2 commits into
masterfrom
node-view

Conversation

@mikemorris

Copy link
Copy Markdown
Contributor

@mikemorris mikemorris added the Node.js node-mapbox-gl-native label Sep 11, 2015
@mikemorris

Copy link
Copy Markdown
Contributor Author

Tagging @jfirebaugh for a review here.

@mikemorris

Copy link
Copy Markdown
Contributor Author
terminate called after throwing an instance of 'std::runtime_error'
  what():  Couldn't create framebuffer: incomplete attachment

Seeing the above error on Travis Linux API.RepeatedRender test.

Comment thread platform/node/src/node_view.hpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should be public Nan::ObjectWrap instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

HAH, yea that's it, thanks!

@mikemorris mikemorris added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Sep 11, 2015
@mikemorris

Copy link
Copy Markdown
Contributor Author

The returns an error test in map.test.js is now segfaulting here:

Process 65928 stopped
* thread #1: tid = 0x696542, 0x00000001031039c1 mapbox-gl-native.node`mbgl::Map::update(this=0x0000000100d0cc80, flags=<unavailable>) + 33 at map.cpp:97, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00000001031039c1 mapbox-gl-native.node`mbgl::Map::update(this=0x0000000100d0cc80, flags=<unavailable>) + 33 at map.cpp:97
   94   void Map::update(Update flags) {
   95       assert(view);
   96       if (flags & Update::Dimensions) {
-> 97           transform->resize(view->getSize());
   98       }
   99       context->invoke(&MapContext::triggerUpdate, transform->getState(), flags);
   100  }

@mikemorris

Copy link
Copy Markdown
Contributor Author

^ Fixed the segfault above (view was still nullptr) and added better error handling (will now throw a JS error when attempting to call map.render before the view has been set or if the view dimensions don't match the requested render dimensions).

View* instead of View&

non-const MapContext::setView

View* all the things

conditional activate in destructor

Conflicts:
	include/mbgl/map/map.hpp
	src/mbgl/map/map.cpp
	src/mbgl/map/map_context.cpp
	src/mbgl/map/map_context.hpp

cleanup without view, require view for Map::renderStill

explicit nullptr View* in MapContext

add view asserts and conditionals
@mikemorris

Copy link
Copy Markdown
Contributor Author

@lucaswoj @bsudekum This should be ready for some perf testing if you want to try building a NodeView cache/pool and swapping in matching views to the NodeMap at render time.

@jfirebaugh

Copy link
Copy Markdown
Contributor

Currently it's looking like we don't need this to get decent performance, though it's possible we'll revisit in a future optimization pass.

@jfirebaugh jfirebaugh closed this Dec 2, 2015
@jfirebaugh
jfirebaugh deleted the node-view branch December 2, 2015 00:26
@1ec5 1ec5 removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Dec 5, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Node.js node-mapbox-gl-native

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants