Index: core/cross/cairo/renderer_cairo.h |
=================================================================== |
--- core/cross/cairo/renderer_cairo.h (revision 57528) |
+++ core/cross/cairo/renderer_cairo.h (working copy) |
@@ -42,6 +42,8 @@ |
namespace o3d { |
+class Image2D; |
+ |
class RendererCairo : public Renderer { |
public: |
static RendererCairo* CreateDefault(ServiceLocator* service_locator); |
@@ -60,13 +62,15 @@ |
// Released all hardware resources. |
virtual void Destroy(); |
- // set the image surface used to render images to the main surface. |
- void SetNewFrame(const void* src_data, unsigned src_width, |
- unsigned src_height, int src_pitch); |
- |
// Paint the frame to the main view |
void Paint(); |
+ // Insert the given Image2D to the back of the array. |
+ void AddImage2D(Image2D* image); |
+ |
+ // Remove the given Image2D from the array. |
+ void RemoveImage2D(Image2D* image); |
+ |
// Handles the plugin resize event. |
virtual void Resize(int width, int height); |
@@ -138,9 +142,15 @@ |
// current platform. |
virtual const int* GetRGBAUByteNSwizzleTable(); |
+ // Overriden from Renderer |
void PushRenderStates(State* state); |
+ // Overrider from Renderer |
+ void PopRenderStates(); |
+ |
protected: |
+ typedef std::vector<Image2D*> Image2DRefArray; |
+ |
// Keep the constructor protected so only factory methods can create |
// renderers. |
explicit RendererCairo(ServiceLocator* service_locator); |
@@ -205,6 +215,14 @@ |
float min_z, |
float max_z); |
+ // Mask the are of image_2d_array[index] that will collide with other images. |
+ // It assumes the image_2d_array has sorted images as index 0 with |
+ // is the most front image. |
+ virtual void MaskArea(cairo_t* cr, int index); |
+ |
+ // Paint the background with black color. |
+ virtual void PaintBackGround(cairo_t* cr); |
+ |
// Linux Client Display |
Display* display_; |
// Linux Client Window |
@@ -213,14 +231,11 @@ |
// Main surface to render cairo |
cairo_surface_t* main_surface_; |
- // Current Frame Data Source |
- const void* frame_src_data_; |
- // Current Frame Source Width |
- unsigned frame_src_width_; |
- // Current Frame Source Height |
- unsigned frame_src_height_; |
- // Current Frame Source Pitch |
- int frame_src_pitch_; |
+ // Draw the background |
+ cairo_t* bg_drawing_; |
+ |
+ // Array of Image2d |
+ Image2DRefArray image_2d_array_; |
}; |
} // namespace o3d |