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

Side by Side Diff: printing/emf_win.cc

Issue 6709009: Stop overloading Init() in NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « printing/emf_win.h ('k') | printing/emf_win_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "printing/emf_win.h" 5 #include "printing/emf_win.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 Emf::Emf() : emf_(NULL), hdc_(NULL) { 49 Emf::Emf() : emf_(NULL), hdc_(NULL) {
50 } 50 }
51 51
52 Emf::~Emf() { 52 Emf::~Emf() {
53 CloseEmf(); 53 CloseEmf();
54 DCHECK(!emf_ && !hdc_); 54 DCHECK(!emf_ && !hdc_);
55 } 55 }
56 56
57 bool Emf::Init(const void* src_buffer, uint32 src_buffer_size) { 57 bool Emf::InitFromData(const void* src_buffer, uint32 src_buffer_size) {
58 DCHECK(!emf_ && !hdc_); 58 DCHECK(!emf_ && !hdc_);
59 emf_ = SetEnhMetaFileBits(src_buffer_size, 59 emf_ = SetEnhMetaFileBits(src_buffer_size,
60 reinterpret_cast<const BYTE*>(src_buffer)); 60 reinterpret_cast<const BYTE*>(src_buffer));
61 return emf_ != NULL; 61 return emf_ != NULL;
62 } 62 }
63 63
64 bool Emf::CreateDc(HDC sibling, const RECT* rect) { 64 bool Emf::CreateDc(HDC sibling, const RECT* rect) {
65 DCHECK(!emf_ && !hdc_); 65 DCHECK(!emf_ && !hdc_);
66 hdc_ = CreateEnhMetaFile(sibling, NULL, rect, NULL); 66 hdc_ = CreateEnhMetaFile(sibling, NULL, rect, NULL);
67 DCHECK(hdc_); 67 DCHECK(hdc_);
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } else { 467 } else {
468 DCHECK_EQ(emf.context_.handle_table, handle_table); 468 DCHECK_EQ(emf.context_.handle_table, handle_table);
469 DCHECK_EQ(emf.context_.objects_count, objects_count); 469 DCHECK_EQ(emf.context_.objects_count, objects_count);
470 DCHECK_EQ(emf.context_.hdc, hdc); 470 DCHECK_EQ(emf.context_.hdc, hdc);
471 } 471 }
472 emf.items_.push_back(Record(&emf.context_, record)); 472 emf.items_.push_back(Record(&emf.context_, record));
473 return 1; 473 return 1;
474 } 474 }
475 475
476 } // namespace printing 476 } // namespace printing
OLDNEW
« no previous file with comments | « printing/emf_win.h ('k') | printing/emf_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698