Remove WebCanvas alias, use cc::PaintCanvas directly in blink

https://chromium-review.googlesource.com/c/chromium/src/+/1112671
This commit is contained in:
Jeremy Apthorp 2018-10-02 15:31:53 -07:00
parent 1adfa4d9da
commit 8d9f24d369
3 changed files with 8 additions and 5 deletions

View file

@ -342,7 +342,7 @@ float PrintWebViewHelper::RenderPageContent(blink::WebLocalFrame* frame,
const gfx::Rect& canvas_area, const gfx::Rect& canvas_area,
const gfx::Rect& content_area, const gfx::Rect& content_area,
double scale_factor, double scale_factor,
blink::WebCanvas* canvas) { cc::PaintCanvas* canvas) {
cc::PaintCanvasAutoRestore auto_restore(canvas, true); cc::PaintCanvasAutoRestore auto_restore(canvas, true);
canvas->translate((content_area.x() - canvas_area.x()) / scale_factor, canvas->translate((content_area.x() - canvas_area.x()) / scale_factor,
(content_area.y() - canvas_area.y()) / scale_factor); (content_area.y() - canvas_area.y()) / scale_factor);

View file

@ -16,7 +16,6 @@
#include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_frame_observer_tracker.h" #include "content/public/renderer/render_frame_observer_tracker.h"
#include "printing/pdf_metafile_skia.h" #include "printing/pdf_metafile_skia.h"
#include "third_party/blink/public/platform/web_canvas.h"
#include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_node.h" #include "third_party/blink/public/web/web_node.h"
#include "third_party/blink/public/web/web_print_params.h" #include "third_party/blink/public/web/web_print_params.h"
@ -35,6 +34,10 @@ namespace blink {
class WebView; class WebView;
} }
namespace cc {
class PaintCanvas;
}
namespace printing { namespace printing {
struct PageSizeMargins; struct PageSizeMargins;
@ -217,7 +220,7 @@ class PrintWebViewHelper
const gfx::Rect& canvas_area, const gfx::Rect& canvas_area,
const gfx::Rect& content_area, const gfx::Rect& content_area,
double scale_factor, double scale_factor,
blink::WebCanvas* canvas); cc::PaintCanvas* canvas);
// Helper methods ----------------------------------------------------------- // Helper methods -----------------------------------------------------------

View file

@ -9,10 +9,10 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h" #include "base/mac/scoped_nsautorelease_pool.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "cc/paint/paint_canvas.h"
#include "chrome/common/print_messages.h" #include "chrome/common/print_messages.h"
#include "printing/metafile_skia_wrapper.h" #include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h" #include "printing/page_size_margins.h"
#include "third_party/blink/public/platform/web_canvas.h"
#include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_local_frame.h"
namespace printing { namespace printing {
@ -117,7 +117,7 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
MetafileSkiaWrapper::SetMetafileOnCanvas(canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(canvas, metafile);
RenderPageContent(frame, page_number, canvas_area, content_area, RenderPageContent(frame, page_number, canvas_area, content_area,
scale_factor, static_cast<blink::WebCanvas*>(canvas)); scale_factor, static_cast<cc::PaintCanvas*>(canvas));
} }
// Done printing. Close the device context to retrieve the compiled metafile. // Done printing. Close the device context to retrieve the compiled metafile.