diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-14 15:14:53 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-14 15:14:53 +0000 |
commit | bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0 (patch) | |
tree | 149a64e70ca634bd43019d639d9ae29ca6d45a9a /chrome/renderer/print_web_view_helper.cc | |
parent | b39627f8eef41a2d4e1f4516bf905d6ad895e56b (diff) | |
download | chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.zip chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.tar.gz chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.tar.bz2 |
Refactor the PlatformContext layer to have only one class.
Previously we had three classes of PlatformCanvas*, one for each platform. Then
we had a typedef of PlatformContext to PlatformCanvas[Mac|Win|Linux] for the
specific platform.
This means that it was almost impossible to forward-declare PlatformCanvas and
there were a bunch of unnecessary includes of platform_canvas.h in header
files.
This change makes there be only one platform_canvas.h header with ifdefs, which
removes a decent amount of duplicated code. There is a platform-independent
file, and one platform-dependent file of platform_canvas for each platform.
I also renamed PlatformDevice[Mac|Win|Linux] to PlatformDevice, althouth in
this case I kept the separate headers since there was much less overlap.
I also broke out CanvasPaint into separate headers so this template doesn't
need to be included all over the project (only a couple of files actually need
it).
Review URL: http://codereview.chromium.org/125109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index c5125e8..d281a76 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -204,7 +204,7 @@ void PrintWebViewHelper::PrintPage(const ViewMsg_PrintPage_Params& params, emf.CreateDc(NULL, NULL); HDC hdc = emf.hdc(); DCHECK(hdc); - skia::PlatformDeviceWin::InitializeDC(hdc); + skia::PlatformDevice::InitializeDC(hdc); // Since WebKit extends the page width depending on the magical shrink // factor we make sure the canvas covers the worst case scenario // (x2.0 currently). PrintContext will then set the correct clipping region. @@ -220,7 +220,7 @@ void PrintWebViewHelper::PrintPage(const ViewMsg_PrintPage_Params& params, // GDI drawing code fails. // Mix of Skia and GDI based. - skia::PlatformCanvasWin canvas(size_x, size_y, true); + skia::PlatformCanvas canvas(size_x, size_y, true); canvas.drawARGB(255, 255, 255, 255, SkPorterDuff::kSrc_Mode); float webkit_shrink = frame->PrintPage(params.page_number, &canvas); if (shrink <= 0) { |