OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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.content.browser; |
| 6 |
| 7 import android.view.Surface; |
| 8 |
| 9 import org.chromium.base.UnguessableToken; |
| 10 import org.chromium.base.annotations.JNINamespace; |
| 11 import org.chromium.content.common.IGpuProcessCallback; |
| 12 import org.chromium.content.common.SurfaceWrapper; |
| 13 |
| 14 @JNINamespace("content") |
| 15 class GpuProcessCallback extends IGpuProcessCallback.Stub { |
| 16 GpuProcessCallback() {} |
| 17 |
| 18 @Override |
| 19 public void forwardSurfaceForSurfaceRequest(UnguessableToken requestToken, S
urface surface) { |
| 20 nativeCompleteScopedSurfaceRequest(requestToken, surface); |
| 21 } |
| 22 |
| 23 @Override |
| 24 public SurfaceWrapper getViewSurface(int surfaceId) { |
| 25 Surface surface = nativeGetViewSurface(surfaceId); |
| 26 if (surface == null) { |
| 27 return null; |
| 28 } |
| 29 return new SurfaceWrapper(surface); |
| 30 } |
| 31 |
| 32 private static native void nativeCompleteScopedSurfaceRequest( |
| 33 UnguessableToken requestToken, Surface surface); |
| 34 private static native Surface nativeGetViewSurface(int surfaceId); |
| 35 }; |
OLD | NEW |