Skip to content

Commit

Permalink
Move surface-based SceneBuilder implementation under surface/ (flutte…
Browse files Browse the repository at this point in the history
…r#13159)

Move surface-based SceneBuilder implementation under surface/
  • Loading branch information
yjbanov authored Oct 16, 2019
1 parent c979817 commit 5fe6083
Show file tree
Hide file tree
Showing 12 changed files with 575 additions and 300 deletions.
1 change: 1 addition & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/opacity.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/picture.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/platform_view.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/scene.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/scene_builder.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/surface.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/transform.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/test_embedding.dart
Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/lib/src/engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ part 'engine/surface/opacity.dart';
part 'engine/surface/picture.dart';
part 'engine/surface/platform_view.dart';
part 'engine/surface/scene.dart';
part 'engine/surface/scene_builder.dart';
part 'engine/surface/surface.dart';
part 'engine/surface/transform.dart';
part 'engine/test_embedding.dart';
Expand Down
21 changes: 21 additions & 0 deletions lib/web_ui/lib/src/engine/surface/scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

part of engine;

class SurfaceScene implements ui.Scene {
/// This class is created by the engine, and should not be instantiated
/// or extended directly.
///
/// To create a Scene object, use a [SceneBuilder].
SurfaceScene(this.webOnlyRootElement);

final html.Element webOnlyRootElement;

/// Creates a raster image representation of the current state of the scene.
/// This is a slow operation that is performed on a background thread.
Future<ui.Image> toImage(int width, int height) {
throw UnsupportedError('toImage is not supported on the Web');
}

/// Releases the resources used by this scene.
///
/// After calling this function, the scene is cannot be used further.
void dispose() {}
}

/// A surface that creates a DOM element for whole app.
class PersistedScene extends PersistedContainerSurface {
PersistedScene(PersistedScene oldLayer) : super(oldLayer) {
Expand Down
Loading

0 comments on commit 5fe6083

Please sign in to comment.