1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package android.openglperf.cts; 17 18 import android.app.Activity; 19 import android.content.Context; 20 import android.opengl.GLSurfaceView; 21 import android.os.Bundle; 22 import android.view.WindowManager; 23 24 public class TextureTestActivity extends Activity { 25 private GLSurfaceView mGLView; 26 27 @Override onCreate(Bundle savedInstanceState)28 public void onCreate(Bundle savedInstanceState) { 29 super.onCreate(savedInstanceState); 30 mGLView = new TextureTestSurfaceView(this); 31 getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD 32 | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON 33 | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON 34 | WindowManager.LayoutParams.FLAG_FULLSCREEN 35 | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); 36 setContentView(mGLView); 37 } 38 39 @Override onPause()40 protected void onPause() { 41 super.onPause(); 42 mGLView.onPause(); 43 } 44 45 @Override onResume()46 protected void onResume() { 47 super.onResume(); 48 mGLView.onResume(); 49 } 50 } 51 52 class TextureTestSurfaceView extends GLSurfaceView { 53 TextureTestSurfaceView(Context context)54 public TextureTestSurfaceView(Context context){ 55 super(context); 56 setRenderer(new TextureTestRenderer()); 57 } 58 }