Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QtTextureView.java
Go to the documentation of this file.
1// Copyright (C) 2014 BogDan Vatra <bogdan@kde.org>
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5package org.qtproject.qt.android;
6
7import android.content.Context;
8import android.graphics.PixelFormat;
9import android.graphics.SurfaceTexture;
10import android.util.Log;
11import android.view.Surface;
12import android.view.TextureView;
13
14public class QtTextureView extends TextureView implements TextureView.SurfaceTextureListener
15{
16 private QtSurfaceInterface m_surfaceCallback;
17 private boolean m_staysOnTop;
18 private Surface m_surface;
19
20 public QtTextureView(Context context, QtSurfaceInterface surfaceCallback, boolean isOpaque)
21 {
22 super(context);
23 setFocusable(false);
24 setFocusableInTouchMode(false);
25 m_surfaceCallback = surfaceCallback;
26 setSurfaceTextureListener(this);
27 setOpaque(isOpaque);
28 setSurfaceTexture(new SurfaceTexture(false));
29 }
30
31 @Override
32 public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height) {
33 m_surface = new Surface(surfaceTexture);
34 m_surfaceCallback.onSurfaceChanged(m_surface);
35 }
36
37 @Override
38 public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int width, int height) {
39 m_surface = new Surface(surfaceTexture);
40 m_surfaceCallback.onSurfaceChanged(m_surface);
41 }
42
43 @Override
44 public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
45 m_surfaceCallback.onSurfaceChanged(null);
46 return true;
47 }
48
49 @Override
50 public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
51 }
52}
QtTextureView(Context context, QtSurfaceInterface surfaceCallback, boolean isOpaque)
void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture)
boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture)
void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int width, int height)
void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height)
static void * context
GLint GLsizei GLsizei height
GLint GLsizei width