- Timestamp:
- 08/15/08 13:25:16 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/BAL/WKAL/Concretizations/Graphics/Cairo/BCGraphicsContextCairo.cpp
r288 r437 38 38 #include "NotImplemented.h" 39 39 #include "Path.h" 40 #include "Pattern.h" 40 41 #include "SimpleFontData.h" 42 41 43 #include <cairo.h> 42 44 #include <math.h> … … 494 496 cairo_get_matrix(cr, &matrix); 495 497 return IntPoint(static_cast<int>(matrix.x0), static_cast<int>(matrix.y0)); 498 } 499 500 void GraphicsContext::applyStrokePattern(const Pattern& pattern) 501 { 502 cairo_pattern_t* platformPattern = pattern.createPlatformPattern(getCTM()); 503 if (!platformPattern) 504 return; 505 506 cairo_set_source(platformContext(), platformPattern); 507 cairo_pattern_destroy(platformPattern); 508 } 509 510 void GraphicsContext::applyFillPattern(const Pattern& pattern) 511 { 512 // The Cairo codepath doesn't seem to support separate stroke/fill? 513 // The code I refactored to create these methods was identical for Cairo 514 applyStrokePattern(pattern); 496 515 } 497 516 … … 880 899 return GDK_DRAWABLE(m_data->expose->window); 881 900 } 882 883 IntPoint GraphicsContext::translatePoint(const IntPoint& point) const884 {885 cairo_matrix_t tm;886 cairo_get_matrix(m_data->cr, &tm);887 double x = point.x();888 double y = point.y();889 890 cairo_matrix_transform_point(&tm, &x, &y);891 return IntPoint(x, y);892 }893 901 #endif 894 902
