Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(944)

Unified Diff: core/cross/cairo/renderer_cairo.h

Issue 2825074: Initial version rendering 2D path for O3D. This will eventually allow O3D app... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/o3d/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/cross/cairo/image_2d.cc ('k') | core/cross/cairo/renderer_cairo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « core/cross/cairo/image_2d.cc ('k') | core/cross/cairo/renderer_cairo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698