156513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall/* 256513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* Copyright (C) 2011 The Android Open Source Project 356513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* 456513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* Licensed under the Apache License, Version 2.0 (the "License"); 556513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* you may not use this file except in compliance with the License. 656513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* You may obtain a copy of the License at 756513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* 856513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* http://www.apache.org/licenses/LICENSE-2.0 956513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* 1056513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* Unless required by applicable law or agreed to in writing, software 1156513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* distributed under the License is distributed on an "AS IS" BASIS, 1256513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1356513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* See the License for the specific language governing permissions and 1456513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall* limitations under the License. 1556513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall*/ 1656513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall#ifndef __COMMON_HOST_CONNECTION_H 1756513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall#define __COMMON_HOST_CONNECTION_H 1856513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 1956513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall#include "IOStream.h" 2056513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall#include "renderControl_enc.h" 2156513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 2256513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallclass GLEncoder; 2356513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallclass gl_client_context_t; 2456513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallclass GL2Encoder; 2556513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallclass gl2_client_context_t; 2656513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 2756513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallclass HostConnection 2856513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall{ 2956513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallpublic: 3056513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall static HostConnection *get(); 3156513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall ~HostConnection(); 3256513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 3356513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall GLEncoder *glEncoder(); 3456513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall GL2Encoder *gl2Encoder(); 3556513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall renderControl_encoder_context_t *rcEncoder(); 3656513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 3756513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall void flush() { 3856513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall if (m_stream) { 3956513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall m_stream->flush(); 4056513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall } 4156513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall } 4256513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 4356513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallprivate: 4456513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall HostConnection(); 4556513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall static gl_client_context_t *s_getGLContext(); 4656513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall static gl2_client_context_t *s_getGL2Context(); 4756513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 4856513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hallprivate: 4956513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall IOStream *m_stream; 5056513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall GLEncoder *m_glEnc; 5156513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall GL2Encoder *m_gl2Enc; 5256513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall renderControl_encoder_context_t *m_rcEnc; 5356513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall}; 5456513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall 5556513f5ff4f3e851c5f0cb38dc8851d18616b3c0Jesse Hall#endif 56