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

Side by Side Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2686033005: Move metafile printing code from platform canvas to PaintCanvas (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/printing/renderer/print_web_view_helper.h" 5 #include "components/printing/renderer/print_web_view_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 1882
1883 // TODO(thestig): Figure out why Linux is different. 1883 // TODO(thestig): Figure out why Linux is different.
1884 #if defined(OS_WIN) 1884 #if defined(OS_WIN)
1885 float webkit_page_shrink_factor = 1885 float webkit_page_shrink_factor =
1886 frame->getPrintPageShrink(params.page_number); 1886 frame->getPrintPageShrink(params.page_number);
1887 float scale_factor = css_scale_factor * webkit_page_shrink_factor; 1887 float scale_factor = css_scale_factor * webkit_page_shrink_factor;
1888 #else 1888 #else
1889 float scale_factor = css_scale_factor; 1889 float scale_factor = css_scale_factor;
1890 #endif 1890 #endif
1891 1891
1892 SkCanvas* canvas = metafile->GetVectorCanvasForNewPage( 1892 SkCanvas* canvas = metafile->GetVectorCanvasForNewPage(
danakj 2017/02/09 23:05:22 This is a PaintCanvas right?
1893 page_size, canvas_area, scale_factor); 1893 page_size, canvas_area, scale_factor);
1894 if (!canvas) 1894 if (!canvas)
1895 return; 1895 return;
1896 1896
1897 MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); 1897 MetafileSkiaWrapper::SetMetafileOnCanvas(canvas, metafile);
1898 1898
1899 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) 1899 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
1900 if (params.params.display_header_footer) { 1900 if (params.params.display_header_footer) {
1901 // TODO(thestig): Figure out why Linux needs this. It is almost certainly 1901 // TODO(thestig): Figure out why Linux needs this. It is almost certainly
1902 // |printingMinimumShrinkFactor| from Blink. 1902 // |printingMinimumShrinkFactor| from Blink.
1903 #if defined(OS_WIN) 1903 #if defined(OS_WIN)
1904 const float fudge_factor = 1; 1904 const float fudge_factor = 1;
1905 #else 1905 #else
1906 const float fudge_factor = kPrintingMinimumShrinkFactor; 1906 const float fudge_factor = kPrintingMinimumShrinkFactor;
1907 #endif 1907 #endif
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 blink::WebConsoleMessage::LevelWarning, message)); 2360 blink::WebConsoleMessage::LevelWarning, message));
2361 return false; 2361 return false;
2362 } 2362 }
2363 2363
2364 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2364 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2365 // Reset counter on successful print. 2365 // Reset counter on successful print.
2366 count_ = 0; 2366 count_ = 0;
2367 } 2367 }
2368 2368
2369 } // namespace printing 2369 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698