1// Copyright 2013 The Flutter Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5part of engine; 6 7/// A surface that creates a DOM element for whole app. 8class PersistedScene extends PersistedContainerSurface { 9 PersistedScene(PersistedScene oldLayer) : super(oldLayer) { 10 _transform = Matrix4.identity(); 11 } 12 13 @override 14 void recomputeTransformAndClip() { 15 // The scene clip is the size of the entire window. 16 // TODO(yjbanov): in the add2app scenario where we might be hosted inside 17 // a custom element, this will be different. We will need to 18 // update this code when we add add2app support. 19 final double screenWidth = html.window.innerWidth.toDouble(); 20 final double screenHeight = html.window.innerHeight.toDouble(); 21 _globalClip = ui.Rect.fromLTRB(0, 0, screenWidth, screenHeight); 22 } 23 24 @override 25 html.Element createElement() { 26 return defaultCreateElement('flt-scene'); 27 } 28 29 @override 30 void apply() {} 31} 32