Mercurial > MadButterfly
comparison src/graph_engine_skia.cpp @ 586:b42d69ab8857 openvg
Replace mbe_clip() with mbe_scissoring()
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 30 Jun 2010 13:28:53 +0800 |
parents | 663d361eb3b8 |
children | ac2e6468a22a |
comparison
equal
deleted
inserted
replaced
585:6af1aa74e57c | 586:b42d69ab8857 |
---|---|
554 | 554 |
555 void mbe_set_source(mbe_t *canvas, mbe_pattern_t *source) { | 555 void mbe_set_source(mbe_t *canvas, mbe_pattern_t *source) { |
556 canvas->states->ptn = source; | 556 canvas->states->ptn = source; |
557 } | 557 } |
558 | 558 |
559 void mbe_reset_clip(mbe_t *canvas) { | 559 void mbe_reset_scissoring(mbe_t *canvas) { |
560 SkRegion clip; | 560 SkRegion clip; |
561 | 561 |
562 _canvas_device_region(canvas->canvas, &clip); | 562 _canvas_device_region(canvas->canvas, &clip); |
563 canvas->canvas->setClipRegion(clip); | 563 canvas->canvas->setClipRegion(clip); |
564 } | 564 } |
778 mbe_fill_preserve(canvas); | 778 mbe_fill_preserve(canvas); |
779 canvas->path->rewind(); | 779 canvas->path->rewind(); |
780 canvas->subpath->rewind(); | 780 canvas->subpath->rewind(); |
781 } | 781 } |
782 | 782 |
783 void mbe_clip(mbe_t *canvas) { | 783 void mbe_scissoring(mbe_t *canvas, int n_areas, area_t **areas) { |
784 if(!canvas->subpath->isEmpty()) | 784 int i; |
785 _update_path(canvas); | 785 area_t *area; |
786 | 786 SkPath *path; |
787 canvas->canvas->clipPath(*canvas->path, SkRegion::kIntersect_Op); | 787 |
788 canvas->path->rewind(); | 788 mbe_new_path(canvas); |
789 canvas->subpath->rewind(); | 789 |
790 path = canvas->path; | |
791 for(i = 0; i < n_areas; i++) { | |
792 area = areas[i]; | |
793 path->addRect(CO_AIX_2_SKSCALAR(area->x), CO_AIX_2_SKSCALAR(area->y), | |
794 CO_AIX_2_SKSCALAR(area->x + area->width), | |
795 CO_AIX_2_SKSCALAR(area->y + area->height)); | |
796 } | |
797 | |
798 canvas->canvas->clipPath(*path, SkRegion::kIntersect_Op); | |
799 path->rewind(); | |
790 } | 800 } |
791 | 801 |
792 mbe_font_face_t * mbe_query_font_face(const char *family, | 802 mbe_font_face_t * mbe_query_font_face(const char *family, |
793 int slant, int weight) {} | 803 int slant, int weight) {} |
794 void mbe_free_font_face(mbe_font_face_t *face) {} | 804 void mbe_free_font_face(mbe_font_face_t *face) {} |