macOS: report the drawable size to the renderer (#4479)
This commit is contained in:
committed by
GitHub
parent
d508e65692
commit
6485d28b3e
@@ -39,6 +39,8 @@ public:
|
||||
MLNBackendResource* getObject() override;
|
||||
void display() override;
|
||||
|
||||
void drawableSizeChanged(CGSize size);
|
||||
|
||||
private:
|
||||
bool presentsWithTransaction = true;
|
||||
};
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
}
|
||||
|
||||
- (void)mtkView:(MTKView*)view drawableSizeWillChange:(CGSize)size {
|
||||
_impl->drawableSizeChanged(size);
|
||||
}
|
||||
|
||||
- (void)drawInMTKView:(MTKView*)view {
|
||||
@@ -134,6 +135,11 @@ MLNMapViewMetalImpl::MLNMapViewMetalImpl(MLNMapView* nativeView_)
|
||||
resource.presentsWithTransaction = presentsWithTransaction;
|
||||
|
||||
[mapView addSubview:resource.mtlView positioned:NSWindowBelow relativeTo:nil];
|
||||
drawableSizeChanged(resource.mtlView.drawableSize);
|
||||
}
|
||||
|
||||
void MLNMapViewMetalImpl::drawableSizeChanged(CGSize drawableSize) {
|
||||
size = {static_cast<uint32_t>(drawableSize.width), static_cast<uint32_t>(drawableSize.height)};
|
||||
}
|
||||
|
||||
MLNMapViewMetalImpl::~MLNMapViewMetalImpl() = default;
|
||||
|
||||
Reference in New Issue
Block a user