Changeset 83745 in webkit
- Timestamp:
- Apr 13, 2011 9:17:37 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83741 r83745 1 2011-04-13 Thierry Reding <thierry.reding@avionic-design.de> 2 3 Gtk+ port fails to build when enabling WebGL 4 https://bugs.webkit.org/show_bug.cgi?id=58434 5 6 Fix the GTK+ WebGL build after the introduction of PlatformContextCairo. 7 8 * platform/graphics/GraphicsContext3D.h: 9 * platform/graphics/cairo/GraphicsContext3DCairo.cpp: 10 (WebCore::GraphicsContext3D::paintToCanvas): 11 1 12 2011-04-12 Philippe Normand <pnormand@igalia.com> 2 13 -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r82878 r83745 64 64 QT_END_NAMESPACE 65 65 #elif PLATFORM(GTK) 66 typedef struct _cairo cairo_t;67 66 typedef unsigned int GLuint; 68 67 #endif … … 92 91 class Image; 93 92 class ImageData; 93 #if PLATFORM(CAIRO) 94 class PlatformContextCairo; 95 #endif 94 96 95 97 struct ActiveInfo { … … 766 768 #elif PLATFORM(GTK) 767 769 void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, 768 int canvasWidth, int canvasHeight, cairo_t* context);770 int canvasWidth, int canvasHeight, PlatformContextCairo* context); 769 771 #endif 770 772 -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
r82878 r83745 28 28 #include "config.h" 29 29 #include "GraphicsContext3D.h" 30 #include "PlatformContextCairo.h" 30 31 31 32 #if ENABLE(WEBGL) … … 84 85 } 85 86 86 void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, cairo_t* context)87 void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, PlatformContextCairo* context) 87 88 { 88 89 if (!imagePixels || imageWidth <= 0 || imageHeight <= 0 || canvasWidth <= 0 || canvasHeight <= 0 || !context) 89 90 return; 90 91 91 cairo_save(context); 92 cairo_t *cr = context->cr(); 93 context->save(); 92 94 93 cairo_rectangle(c ontext, 0, 0, canvasWidth, canvasHeight);94 cairo_set_operator(c ontext, CAIRO_OPERATOR_CLEAR);95 cairo_paint(c ontext);95 cairo_rectangle(cr, 0, 0, canvasWidth, canvasHeight); 96 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR); 97 cairo_paint(cr); 96 98 97 99 RefPtr<cairo_surface_t> imageSurface = adoptRef(cairo_image_surface_create_for_data( … … 99 101 100 102 // OpenGL keeps the pixels stored bottom up, so we need to flip the image here. 101 cairo_translate(c ontext, 0, imageHeight);102 cairo_scale(c ontext, 1, -1);103 cairo_translate(cr, 0, imageHeight); 104 cairo_scale(cr, 1, -1); 103 105 104 cairo_set_operator(c ontext, CAIRO_OPERATOR_OVER);105 cairo_set_source_surface(c ontext, imageSurface.get(), 0, 0);106 cairo_rectangle(c ontext, 0, 0, canvasWidth, -canvasHeight);106 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); 107 cairo_set_source_surface(cr, imageSurface.get(), 0, 0); 108 cairo_rectangle(cr, 0, 0, canvasWidth, -canvasHeight); 107 109 108 cairo_fill(c ontext);109 c airo_restore(context);110 cairo_fill(cr); 111 context->restore(); 110 112 } 111 113
Note: See TracChangeset
for help on using the changeset viewer.