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

Side by Side Diff: core/fxge/win32/cpsoutput.cpp

Issue 2615703002: Revert postscript code removal. (Closed)
Patch Set: Move files, remove extra class, remove non const refs Created 3 years, 11 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 | « core/fxge/win32/cpsoutput.h ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "core/fxge/win32/cpsoutput.h"
8
9 #include <algorithm>
10
11 #include "core/fxcrt/fx_system.h"
12
13 CPSOutput::CPSOutput(HDC hDC) {
14 m_hDC = hDC;
15 }
16
17 CPSOutput::~CPSOutput() {}
18
19 void CPSOutput::Release() {
20 delete this;
21 }
22
23 void CPSOutput::OutputPS(const FX_CHAR* str, int len) {
24 if (len < 0)
25 len = static_cast<int>(FXSYS_strlen(str));
26
27 int sent_len = 0;
28 while (len > 0) {
29 FX_CHAR buffer[1026];
30 int send_len = std::min(len, 1024);
31 *(reinterpret_cast<uint16_t*>(buffer)) = send_len;
32 FXSYS_memcpy(buffer + 2, str + sent_len, send_len);
33
34 // TODO(thestig/rbpotter): Do PASSTHROUGH for non-Chromium usage.
35 // ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, buffer, 0, nullptr);
36 ::GdiComment(m_hDC, send_len + 2, reinterpret_cast<const BYTE*>(buffer));
37 sent_len += send_len;
38 len -= send_len;
39 }
40 }
OLDNEW
« no previous file with comments | « core/fxge/win32/cpsoutput.h ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698