Bug 1316750, part 3 - Add special case code to handle CAIRO_SURFACE_TYPE_WIN32 in PrintTarget::GetReferenceDrawTarget. r=edwin
authorJonathan Watt <jwatt@jwatt.org>
Tue, 15 Nov 2016 23:12:09 +0000
changeset 367776 ba22cd08d1236504e79bc55cccd7a99fa2a7761d
parent 367775 8fedd88f64885a8ec64e587f185d557ff718d2cc
child 367777 fe64a3cfb7f03798a474a2e6882ec50333c08714
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1316750
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1316750, part 3 - Add special case code to handle CAIRO_SURFACE_TYPE_WIN32 in PrintTarget::GetReferenceDrawTarget. r=edwin
gfx/thebes/PrintTarget.cpp
--- a/gfx/thebes/PrintTarget.cpp
+++ b/gfx/thebes/PrintTarget.cpp
@@ -8,16 +8,17 @@
 #include "cairo.h"
 #ifdef CAIRO_HAS_QUARTZ_SURFACE
 #include "cairo-quartz.h"
 #endif
 #ifdef CAIRO_HAS_WIN32_SURFACE
 #include "cairo-win32.h"
 #endif
 #include "mozilla/gfx/2D.h"
+#include "mozilla/gfx/HelpersCairo.h"
 #include "mozilla/gfx/Logging.h"
 
 namespace mozilla {
 namespace gfx {
 
 PrintTarget::PrintTarget(cairo_surface_t* aCairoSurface, const IntSize& aSize)
   : mCairoSurface(aCairoSurface)
   , mSize(aSize)
@@ -94,16 +95,20 @@ PrintTarget::GetReferenceDrawTarget(Draw
 {
   if (!mRefDT) {
     const IntSize size(1, 1);
 
     cairo_surface_t* similar;
     switch (cairo_surface_get_type(mCairoSurface)) {
 #ifdef CAIRO_HAS_WIN32_SURFACE
     case CAIRO_SURFACE_TYPE_WIN32:
+      similar = cairo_win32_surface_create_with_dib(
+        CairoContentToCairoFormat(cairo_surface_get_content(mCairoSurface)),
+        size.width, size.height);
+      break;
 #endif
 #ifdef CAIRO_HAS_QUARTZ_SURFACE
     case CAIRO_SURFACE_TYPE_QUARTZ:
       similar = cairo_quartz_surface_create_cg_layer(
                   mCairoSurface, cairo_surface_get_content(mCairoSurface),
                   size.width, size.height);
       break;
 #endif