Reland patch ensure font load before calling Skia during printing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2011 05:37:32 +0000 (05:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2011 05:37:32 +0000 (05:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70390

Patch by Arthur Hsu <arthurhsu@chromium.org> on 2011-10-27
Reviewed by James Robinson.

* platform/graphics/chromium/FontChromiumWin.cpp:
(WebCore::Font::drawGlyphs):
* platform/graphics/skia/SkiaFontWin.cpp:
(WebCore::paintSkiaText):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98692 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
Source/WebCore/platform/graphics/skia/SkiaFontWin.cpp

index 45b889f..858ca0a 100755 (executable)
@@ -1,3 +1,15 @@
+2011-10-27  Arthur Hsu  <arthurhsu@chromium.org>
+
+        Reland patch ensure font load before calling Skia during printing
+        https://bugs.webkit.org/show_bug.cgi?id=70390
+
+        Reviewed by James Robinson.
+
+        * platform/graphics/chromium/FontChromiumWin.cpp:
+        (WebCore::Font::drawGlyphs):
+        * platform/graphics/skia/SkiaFontWin.cpp:
+        (WebCore::paintSkiaText):
+
 2011-10-27  Adam Barth  <abarth@webkit.org>
 
         Attempt to fix the Qt build.
 2011-10-27  Adam Barth  <abarth@webkit.org>
 
         Attempt to fix the Qt build.
index c2f1664..b1c452d 100644 (file)
@@ -395,7 +395,6 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext,
         return;
 
     HFONT hfont = font->platformData().hfont();
         return;
 
     HFONT hfont = font->platformData().hfont();
-    PlatformSupport::ensureFontLoaded(hfont);
 
     // We draw the glyphs in chunks to avoid having to do a heap allocation for
     // the arrays of characters and advances.
 
     // We draw the glyphs in chunks to avoid having to do a heap allocation for
     // the arrays of characters and advances.
index a3efea6..d6b5f43 100644 (file)
 
 #include "AffineTransform.h"
 #include "PlatformContextSkia.h"
 
 #include "AffineTransform.h"
 #include "PlatformContextSkia.h"
+#include "PlatformSupport.h"
 #include "Gradient.h"
 #include "Pattern.h"
 #include "SkCanvas.h"
 #include "Gradient.h"
 #include "Pattern.h"
 #include "SkCanvas.h"
+#include "SkDevice.h"
 #include "SkPaint.h"
 #include "SkShader.h"
 #include "SkTemplates.h"
 #include "SkPaint.h"
 #include "SkShader.h"
 #include "SkTemplates.h"
@@ -236,6 +238,9 @@ void paintSkiaText(GraphicsContext* context,
     PlatformContextSkia* platformContext = context->platformContext();
     SkCanvas* canvas = platformContext->canvas();
     TextDrawingModeFlags textMode = platformContext->getTextDrawingMode();
     PlatformContextSkia* platformContext = context->platformContext();
     SkCanvas* canvas = platformContext->canvas();
     TextDrawingModeFlags textMode = platformContext->getTextDrawingMode();
+    // Ensure font load for printing, because PDF device needs it.
+    if (canvas->getTopDevice()->getDeviceCapabilities() & SkDevice::kVector_Capability)
+        PlatformSupport::ensureFontLoaded(hfont);
 
     // Filling (if necessary). This is the common case.
     SkPaint paint;
 
     // Filling (if necessary). This is the common case.
     SkPaint paint;