diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 01:57:38 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 01:57:38 +0000 |
commit | 0064b398edd44fb98f9a5964a1bfbbd1bb41c869 (patch) | |
tree | 39801508dd7ce1802cddb8456f17f752d7f8927a /printing/emf_win.h | |
parent | 45070024ddc42410274943d0e2a55a72e29837da (diff) | |
download | chromium_src-0064b398edd44fb98f9a5964a1bfbbd1bb41c869.zip chromium_src-0064b398edd44fb98f9a5964a1bfbbd1bb41c869.tar.gz chromium_src-0064b398edd44fb98f9a5964a1bfbbd1bb41c869.tar.bz2 |
Restore DC before EndPage call to state if was just after StartPage. We need this because EndPage clips page with current clipping region.
BUG=71509
TEST=unittest
Review URL: https://chromiumcodereview.appspot.com/10557019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/emf_win.h')
-rw-r--r-- | printing/emf_win.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/printing/emf_win.h b/printing/emf_win.h index 8317627..b593e24 100644 --- a/printing/emf_win.h +++ b/printing/emf_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -113,9 +113,13 @@ class PRINTING_EXPORT Emf : public Metafile { }; struct Emf::EnumerationContext { + EnumerationContext(); + HANDLETABLE* handle_table; int objects_count; HDC hdc; + const XFORM* base_matrix; + int dc_on_page_start; }; // One EMF record. It keeps pointers to the EMF buffer held by Emf::emf_. @@ -123,24 +127,22 @@ struct Emf::EnumerationContext { class PRINTING_EXPORT Emf::Record { public: // Plays the record. - bool Play() const; + bool Play(EnumerationContext* context) const; // Plays the record working around quirks with SetLayout, // SetWorldTransform and ModifyWorldTransform. See implementation for details. - bool SafePlayback(const XFORM* base_matrix) const; + bool SafePlayback(EnumerationContext* context) const; // Access the underlying EMF record. const ENHMETARECORD* record() const { return record_; } protected: - Record(const EnumerationContext* context, - const ENHMETARECORD* record); + explicit Record(const ENHMETARECORD* record); private: friend class Emf; friend class Enumerator; const ENHMETARECORD* record_; - const EnumerationContext* context_; }; // Retrieves individual records out of a Emf buffer. The main use is to skip @@ -163,6 +165,8 @@ class PRINTING_EXPORT Emf::Enumerator { const_iterator end() const; private: + FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, Enumerate); + // Processes one EMF record and saves it in the items_ array. static int CALLBACK EnhMetaFileProc(HDC hdc, HANDLETABLE* handle_table, |