Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1164683007: Copy SkMetaData before painting printed plugin contents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/paint/SkPictureBuilder.h ('k') | Source/web/WebPluginContainerImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index 976f27ca4093ce89693f8d308997eea6b83021f8..d9a86839226615399258cdcb3a7f3b4ca257f04e 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -208,6 +208,7 @@
#include "public/web/WebScriptSource.h"
#include "public/web/WebSerializedScriptValue.h"
#include "public/web/WebTreeScopeType.h"
+#include "skia/ext/platform_device.h"
#include "web/AssociatedURLLoader.h"
#include "web/CompositionUnderlineVectorBuilder.h"
#include "web/FindInPageCoordinates.h"
@@ -360,7 +361,8 @@ public:
return 0;
IntRect pageRect = m_pageRects[pageNumber];
- SkPictureBuilder pictureBuilder(pageRect);
+ SkPictureBuilder pictureBuilder(pageRect, GraphicsContext::NothingDisabled, &skia::getMetaData(*canvas));
+ pictureBuilder.context().setPrinting(true);
float scale = spoolPage(pictureBuilder.context(), pageNumber);
pictureBuilder.endRecording()->playback(canvas);
@@ -385,7 +387,9 @@ public:
int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1;
IntRect allPagesRect(0, 0, pageWidth, totalHeight);
- SkPictureBuilder pictureBuilder(allPagesRect);
+ SkPictureBuilder pictureBuilder(allPagesRect, GraphicsContext::NothingDisabled, &skia::getMetaData(*canvas));
+ pictureBuilder.context().setPrinting(true);
+
GraphicsContext& context = pictureBuilder.context();
// Fill the whole background by white.
@@ -441,8 +445,6 @@ protected:
IntRect pageRect = m_pageRects[pageNumber];
float scale = m_printedPageWidth / pageRect.width();
- context.setPrinting(true);
-
AffineTransform transform;
#if OS(POSIX) && !OS(MACOSX)
transform.scale(scale);
@@ -520,7 +522,9 @@ protected:
// instead. Returns the scale to be applied.
virtual float spoolPage(GraphicsContext& context, int pageNumber) override
{
- m_plugin->printPage(pageNumber, &context);
+ IntRect pageRect = m_pageRects[pageNumber];
+ m_plugin->printPage(pageNumber, &context, pageRect);
+
return 1.0;
}
« no previous file with comments | « Source/platform/graphics/paint/SkPictureBuilder.h ('k') | Source/web/WebPluginContainerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698