Mercurial > MadButterfly
comparison src/redraw_man.c @ 469:4dc0be6c044a Android_Skia
Add copy and clear graphic engine functions.
To replace set/get options, copy and clear is more meanful,
functional, and independently. set/get options are too graphic engine
dependently.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 12 Nov 2009 21:30:35 +0800 |
parents | 6e18550c8fa8 |
children | ba64f928542b |
comparison
equal
deleted
inserted
replaced
468:ae784a86ba82 | 469:4dc0be6c044a |
---|---|
1863 } | 1863 } |
1864 } | 1864 } |
1865 | 1865 |
1866 #ifndef UNITTEST | 1866 #ifndef UNITTEST |
1867 static void clear_canvas(canvas_t *canvas) { | 1867 static void clear_canvas(canvas_t *canvas) { |
1868 mbe_operator_t old_op; | 1868 mbe_clear(canvas); |
1869 | |
1870 old_op = mbe_get_operator(canvas); | |
1871 mbe_set_operator(canvas, MBE_OPERATOR_CLEAR); | |
1872 mbe_paint(canvas); | |
1873 mbe_set_operator(canvas, old_op); | |
1874 } | 1869 } |
1875 | 1870 |
1876 static void make_clip(mbe_t *cr, int n_dirty_areas, | 1871 static void make_clip(mbe_t *cr, int n_dirty_areas, |
1877 area_t **dirty_areas) { | 1872 area_t **dirty_areas) { |
1878 int i; | 1873 int i; |
1890 mbe_reset_clip(cr); | 1885 mbe_reset_clip(cr); |
1891 } | 1886 } |
1892 | 1887 |
1893 static void copy_cr_2_backend(redraw_man_t *rdman, int n_dirty_areas, | 1888 static void copy_cr_2_backend(redraw_man_t *rdman, int n_dirty_areas, |
1894 area_t **dirty_areas) { | 1889 area_t **dirty_areas) { |
1895 mbe_operator_t saved_op; | |
1896 | |
1897 if(n_dirty_areas) | 1890 if(n_dirty_areas) |
1898 make_clip(rdman->backend, n_dirty_areas, dirty_areas); | 1891 make_clip(rdman->backend, n_dirty_areas, dirty_areas); |
1899 | 1892 |
1900 saved_op = mbe_get_operator(rdman->backend); | 1893 mbe_copy_source(rdman->backend); |
1901 mbe_set_operator(rdman->backend, MBE_OPERATOR_SOURCE); | |
1902 mbe_paint(rdman->backend); | |
1903 mbe_set_operator(rdman->backend, saved_op); | |
1904 } | 1894 } |
1905 #else /* UNITTEST */ | 1895 #else /* UNITTEST */ |
1906 static void make_clip(mbe_t *cr, int n_dirty_areas, | 1896 static void make_clip(mbe_t *cr, int n_dirty_areas, |
1907 area_t **dirty_areas) { | 1897 area_t **dirty_areas) { |
1908 } | 1898 } |