Show
Ignore:
Timestamp:
08/15/08 13:25:16 (5 months ago)
Author:
mbensi
Message:

merge with webkit revision 35774

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/BAL/WKAL/Concretizations/Graphics/Cairo/BCGraphicsContextCairo.cpp

    r288 r437  
    3838#include "NotImplemented.h" 
    3939#include "Path.h" 
     40#include "Pattern.h" 
    4041#include "SimpleFontData.h" 
     42 
    4143#include <cairo.h> 
    4244#include <math.h> 
     
    494496    cairo_get_matrix(cr, &matrix); 
    495497    return IntPoint(static_cast<int>(matrix.x0), static_cast<int>(matrix.y0)); 
     498} 
     499 
     500void 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 
     510void 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); 
    496515} 
    497516 
     
    880899    return GDK_DRAWABLE(m_data->expose->window); 
    881900} 
    882  
    883 IntPoint GraphicsContext::translatePoint(const IntPoint& point) const 
    884 { 
    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 } 
    893901#endif 
    894902