1 // Copyright 2019 The Chromium 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 
5 package org.chromium.components.thinwebview;
6 
7 import android.content.Context;
8 
9 import org.chromium.components.thinwebview.internal.CompositorViewImpl;
10 import org.chromium.ui.base.WindowAndroid;
11 
12 /**
13  * Factory for creating a {@link CompositorView}.
14  */
15 public class CompositorViewFactory {
16     /**
17      * Creates a {@link CompositorView} backed by a {@link Surface}. The surface is provided by
18      * a either a {@link TextureView} or {@link SurfaceView}.
19      * @param context The context to create this view.
20      * @param windowAndroid The associated {@code WindowAndroid} on which the view is to be
21      *         displayed.
22      * @param constraints A set of constraints associated with this view.
23      */
create( Context context, WindowAndroid windowAndroid, ThinWebViewConstraints constraints)24     public static CompositorView create(
25             Context context, WindowAndroid windowAndroid, ThinWebViewConstraints constraints) {
26         return new CompositorViewImpl(context, windowAndroid, constraints);
27     }
28 }
29