rive-app / rive-app/rive-flutter

RiveNativeRenderTexture missing presentingNativeTexture() and swapchain() accessors in windows/include/rive_native/rive_native_plugin.hpp

Open
#611 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
1.5k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

Description
RiveNativeRenderTexture holds a FlutterWindowsSwapchain m_swapchain and a void* m_riveRenderer, but provides no way to retrieve the currently-presenting D3D11 texture or access the swapchain. External code that needs to bridge the Rive texture to another D3D11 device (via DXGI shared handles) cannot reach the swapchain texture.

Changes We Made
Added two public members to RiveNativeRenderTexture in rive_native_plugin.hpp:

// Returns the raw ID3D11Texture2D* of the currently-presenting swapchain
 // texture. Thread-safe (briefly locks the swapchain mutex).
 void *presentingNativeTexture();

 // Access the swapchain for the presenting texture lock.
 FlutterWindowsSwapchain *swapchain() { return &m_swapchain; }

With the implementation in rive_native_plugin.cpp:

void* RiveNativeRenderTexture::presentingNativeTexture() {
  FlutterWindowsSwapchain::PresentingTextureLock lock(&m_swapchain);
  const auto& tex = lock.texture();
  if (!tex || !tex->nativeTexture) return nullptr;
  return tex->nativeTexture.Get();
}

Impact
Without these accessors, the only way to reach the presenting texture is through the internal m_swapchain member, which is private.

Environment

  • Package: rive_native 0.1.2
  • Platform: Windows (D3D11)
  • File: windows/include/rive_native/rive_native_plugin.hpp

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read windows/include/rive_native/rive_native_plugin.hpp and the corresponding implementation in rive_native_plugin.cpp, focusing on RiveNativeRenderTexture and FlutterWindowsSwapchain::PresentingTextureLock. Verify that the two public accessors expose the presenting native texture and swapchain as described, with null handling for an unavailable texture.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, flutter
Domain
computer-graphics, desktop
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.