Repository navigation
Add backend texture support (eg video, camera) - #12525
Conversation
| final Rect rect; | ||
|
|
||
| /// Identity of the backend texture. | ||
| final int textureId; |
There was a problem hiding this comment.
what's the namespace of the textureIds? If a developer starts passing random values here, or walks up all the values possible, what are the implications?
|
|
||
| /// A composited layer that maps a backend texture to a rectangle. | ||
| /// | ||
| /// Texture layers are always leaves in the layer tree. |
There was a problem hiding this comment.
this should discuss where you get a "backend texture" and what it means.
| /// Bounding rectangle of this layer. | ||
| final Rect rect; | ||
|
|
||
| /// Identity of the backend texture. |
There was a problem hiding this comment.
this should document where you get this number.
There was a problem hiding this comment.
Done (in the class-level documentation on all three classes).
| @@ -0,0 +1,66 @@ | |||
| // Copyright 2015 The Chromium Authors. All rights reserved. | |||
| int _textureId; | ||
|
|
||
| /// Sets the identity of the backend texture to map. | ||
| set textureId(int value) { |
There was a problem hiding this comment.
looks like yes; please document that it can be null and define what this means
There was a problem hiding this comment.
A null texture ID is now considered an error.
Done.
| } | ||
|
|
||
| /// The identity of the backend texture. | ||
| int get textureId => _textureId; |
There was a problem hiding this comment.
please order these as follows:
/// documentation
getter;
final _field;
/// documentation (if it is meaningfully different than the getter's)
setter;| void paint(PaintingContext context, Offset offset) { | ||
| if (_textureId == null) { | ||
| return; | ||
| } |
| void updateRenderObject(BuildContext context, TextureBox renderObject) { | ||
| renderObject.textureId = textureId; | ||
| } | ||
| } |
There was a problem hiding this comment.
(remember to propagate documentation updates to this class too)
|
tests? |
|
Sorry to bother, Thank you a lot. |
|
@sroddy Thanks for your interest. We're actively working on it; hoping to land within a week or so. |
|
that would be a lifesaver because its a big road blocker in mine and quite a number of other apps on my table (which I will use flutter at all cost) too so I have been waiting like forever...if this is done does that help with maps too? @mravn-google |
mravn-google
left a comment
There was a problem hiding this comment.
Thanks for the review. PTAL.
| @@ -0,0 +1,66 @@ | |||
| // Copyright 2015 The Chromium Authors. All rights reserved. | |||
| } | ||
|
|
||
| /// The identity of the backend texture. | ||
| int get textureId => _textureId; |
| int _textureId; | ||
|
|
||
| /// Sets the identity of the backend texture to map. | ||
| set textureId(int value) { |
There was a problem hiding this comment.
A null texture ID is now considered an error.
Done.
|
|
||
| /// A composited layer that maps a backend texture to a rectangle. | ||
| /// | ||
| /// Texture layers are always leaves in the layer tree. |
| void paint(PaintingContext context, Offset offset) { | ||
| if (_textureId == null) { | ||
| return; | ||
| } |
| void updateRenderObject(BuildContext context, TextureBox renderObject) { | ||
| renderObject.textureId = textureId; | ||
| } | ||
| } |
| /// Bounding rectangle of this layer. | ||
| final Rect rect; | ||
|
|
||
| /// Identity of the backend texture. |
There was a problem hiding this comment.
Done (in the class-level documentation on all three classes).
| final Rect rect; | ||
|
|
||
| /// Identity of the backend texture. | ||
| final int textureId; |
|
@MichaelSowah I do not yet know what it would take to have native map components render into a provided texture. On top of that, we'd have to relay gestures to the native component, probably allowing Flutter to filter those gestures (in case Flutter has added overlays). Experiments will begin once this PR lands. |
|
Thanks, For starters videos and camera, as you are trying to do here will be a great start for me to be able to lunch the apps for my clients...I hope and pray it lands soon like within the week as you or so as you said , just keeping my fingers crossed for this week and next week @mravn-google |
Adds support for mapping a backend texture to a rectangular widget. This enables the creation of plugins for inline video, camera, OpenGL, etc.
Corresponding flutter/engine PR: flutter-team-archive/engine/pull/4159.
An end-to-end test is wip.