1 /*
2 * Copyright (C) 2011 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 #include "NativeSubWindow.h"
17 #include <android/native_window.h>
18
19 #include <stdio.h>
20
createSubWindow(FBNativeWindowType p_window,int x,int y,int width,int height,SubWindowRepaintCallback repaint_callback,void * repaint_callback_param,int hideWindow)21 EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
22 int x,
23 int y,
24 int width,
25 int height,
26 SubWindowRepaintCallback repaint_callback,
27 void* repaint_callback_param,
28 int hideWindow) {
29 ANativeWindow_acquire(p_window);
30 ANativeWindow_setBuffersGeometry(p_window, width, height, AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM);
31 return p_window;
32 }
33
destroySubWindow(EGLNativeWindowType win)34 void destroySubWindow(EGLNativeWindowType win) {
35 ANativeWindow_release(win);
36 }
37
moveSubWindow(FBNativeWindowType p_parent_window,EGLNativeWindowType p_sub_window,int x,int y,int width,int height)38 int moveSubWindow(FBNativeWindowType p_parent_window,
39 EGLNativeWindowType p_sub_window,
40 int x,
41 int y,
42 int width,
43 int height) {
44 // moving windows not supported in Android; we can't create an actual sub window
45 return true;
46 }
47