2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Flora License, Version 1.1 (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
8 * http://floralicense.org/license/
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.
17 * @file RenderBuffer.h
18 * @author Yunchan Cho (yunchan.cho@samsung.com)
20 #ifndef RENDER_BUFFER_H
21 #define RENDER_BUFFER_H
25 #include "IRenderBuffer.h"
27 // forward declaration
28 struct livebox_buffer;
31 typedef struct livebox_buffer* BufferInfoPtr;
32 typedef void* BufferAddrPtr;
34 #define EXPORT_CLASS __attribute__ ((visibility("default"))
36 class EXPORT_CLASS RenderBuffer: public IRenderBuffer {
38 // IRenderBuffer Implementation
40 bool reallocate(int width, int height);
42 Evas_Object* getWindow();
44 static void preRenderCallback(void* data, Evas* canvas, void* eventInfo);
45 static void postRenderCallback(void* data, Evas* canvas, void* eventInfo);
47 virtual ~RenderBuffer();
50 void startCanvasUpdate();
51 void stopCanvasUpdate();
52 void paintColor(unsigned int color);
54 Evas_Object* getSnapshot();
56 // provided by derived class
57 virtual int getWidth() = 0;
58 virtual int getHeight() = 0;
59 virtual void setWidth(int width) = 0;
60 virtual void setHeight(int height) = 0;
61 virtual BufferInfoPtr acquireBuffer() = 0;
62 virtual void updateBuffer() = 0;
68 static void* allocateCallback(void* data, int size);
69 static void freeCallback(void* data, void *pix);
74 BufferAddrPtr m_bufferAddr;
75 BufferInfoPtr m_bufferInfo;