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

Side by Side Diff: chrome/renderer/mock_printer_driver_win.cc

Issue 125109: Refactor the PlatformContext layer to have only one class. (Closed)
Patch Set: Created 11 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 unified diff | Download patch
« no previous file with comments | « chrome/plugin/webplugin_proxy.cc ('k') | chrome/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/renderer/mock_printer_driver_win.h" 5 #include "chrome/renderer/mock_printer_driver_win.h"
6 6
7 #include "base/gfx/gdi_util.h" 7 #include "base/gfx/gdi_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/common/gfx/emf.h" 9 #include "chrome/common/gfx/emf.h"
10 #include "chrome/renderer/mock_printer.h" 10 #include "chrome/renderer/mock_printer.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return NULL; 68 return NULL;
69 69
70 void* bits; 70 void* bits;
71 bitmap_ = CreateDIBSection(dc_, reinterpret_cast<BITMAPINFO*>(&header), 0, 71 bitmap_ = CreateDIBSection(dc_, reinterpret_cast<BITMAPINFO*>(&header), 0,
72 &bits, NULL, 0); 72 &bits, NULL, 0);
73 if (!bitmap_ || !bits) 73 if (!bitmap_ || !bits)
74 return NULL; 74 return NULL;
75 75
76 SelectObject(dc_, bitmap_); 76 SelectObject(dc_, bitmap_);
77 77
78 skia::PlatformDeviceWin::InitializeDC(dc_); 78 skia::PlatformDevice::InitializeDC(dc_);
79 emf->Playback(dc_, NULL); 79 emf->Playback(dc_, NULL);
80 80
81 return reinterpret_cast<uint8*>(bits); 81 return reinterpret_cast<uint8*>(bits);
82 } 82 }
83 83
84 private: 84 private:
85 HDC dc_; 85 HDC dc_;
86 HBITMAP bitmap_; 86 HBITMAP bitmap_;
87 }; 87 };
88 88
(...skipping 27 matching lines...) Expand all
116 if (!bitmap_data) 116 if (!bitmap_data)
117 return NULL; 117 return NULL;
118 118
119 // Create a new MockPrinterPage instance and return it. 119 // Create a new MockPrinterPage instance and return it.
120 size_t row_byte_width = rect.width() * 4; 120 size_t row_byte_width = rect.width() * 4;
121 size_t bitmap_size = row_byte_width * rect.height(); 121 size_t bitmap_size = row_byte_width * rect.height();
122 return new MockPrinterPage(rect.width(), rect.height(), 122 return new MockPrinterPage(rect.width(), rect.height(),
123 source_data, source_size, 123 source_data, source_size,
124 bitmap_data, bitmap_size); 124 bitmap_data, bitmap_size);
125 } 125 }
OLDNEW
« no previous file with comments | « chrome/plugin/webplugin_proxy.cc ('k') | chrome/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698