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

Side by Side Diff: Source/core/page/PrintContext.h

Issue 1172463002: Fix print context to work under slimming paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unnecessary RuntimeEnabledFeatures include. Created 5 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 | « no previous file | Source/core/page/PrintContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 2 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
3 * Copyright (C) 2007 Apple Inc. 3 * Copyright (C) 2007 Apple Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 10 matching lines...) Expand all
21 #ifndef PrintContext_h 21 #ifndef PrintContext_h
22 #define PrintContext_h 22 #define PrintContext_h
23 23
24 #include "core/CoreExport.h" 24 #include "core/CoreExport.h"
25 #include "platform/heap/Handle.h" 25 #include "platform/heap/Handle.h"
26 #include "wtf/Forward.h" 26 #include "wtf/Forward.h"
27 #include "wtf/HashMap.h" 27 #include "wtf/HashMap.h"
28 #include "wtf/Vector.h" 28 #include "wtf/Vector.h"
29 #include "wtf/text/WTFString.h" 29 #include "wtf/text/WTFString.h"
30 30
31 class SkCanvas;
32
31 namespace blink { 33 namespace blink {
32 34
33 class Element; 35 class Element;
34 class LocalFrame; 36 class LocalFrame;
35 class FloatRect; 37 class FloatRect;
36 class FloatSize; 38 class FloatSize;
37 class GraphicsContext;
38 class IntRect; 39 class IntRect;
39 class Node; 40 class Node;
40 41
41 class CORE_EXPORT PrintContext : public NoBaseWillBeGarbageCollectedFinalized<Pr intContext> { 42 class CORE_EXPORT PrintContext : public NoBaseWillBeGarbageCollectedFinalized<Pr intContext> {
42 public: 43 public:
43 explicit PrintContext(LocalFrame*); 44 explicit PrintContext(LocalFrame*);
44 virtual ~PrintContext(); 45 virtual ~PrintContext();
45 46
46 LocalFrame* frame() const { return m_frame; } 47 LocalFrame* frame() const { return m_frame; }
47 48
(...skipping 22 matching lines...) Expand all
70 // Used by layout tests. 71 // Used by layout tests.
71 static int pageNumberForElement(Element*, const FloatSize& pageSizeInPixels) ; // Returns -1 if page isn't found. 72 static int pageNumberForElement(Element*, const FloatSize& pageSizeInPixels) ; // Returns -1 if page isn't found.
72 static String pageProperty(LocalFrame* frame, const char* propertyName, int pageNumber); 73 static String pageProperty(LocalFrame* frame, const char* propertyName, int pageNumber);
73 static bool isPageBoxVisible(LocalFrame* frame, int pageNumber); 74 static bool isPageBoxVisible(LocalFrame* frame, int pageNumber);
74 static String pageSizeAndMarginsInPixels(LocalFrame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int mar ginLeft); 75 static String pageSizeAndMarginsInPixels(LocalFrame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int mar ginLeft);
75 static int numberOfPages(LocalFrame*, const FloatSize& pageSizeInPixels); 76 static int numberOfPages(LocalFrame*, const FloatSize& pageSizeInPixels);
76 77
77 DECLARE_VIRTUAL_TRACE(); 78 DECLARE_VIRTUAL_TRACE();
78 79
79 protected: 80 protected:
80 void outputLinkedDestinations(GraphicsContext&, const IntRect& pageRect); 81 void outputLinkedDestinations(SkCanvas*, const IntRect& pageRect);
81 82
82 RawPtrWillBeMember<LocalFrame> m_frame; 83 RawPtrWillBeMember<LocalFrame> m_frame;
83 Vector<IntRect> m_pageRects; 84 Vector<IntRect> m_pageRects;
84 85
85 private: 86 private:
86 void computePageRectsWithPageSizeInternal(const FloatSize& pageSizeInPixels) ; 87 void computePageRectsWithPageSizeInternal(const FloatSize& pageSizeInPixels) ;
87 void collectLinkedDestinations(Node*); 88 void collectLinkedDestinations(Node*);
88 89
89 // Used to prevent misuses of begin() and end() (e.g., call end without begi n). 90 // Used to prevent misuses of begin() and end() (e.g., call end without begi n).
90 bool m_isPrinting; 91 bool m_isPrinting;
91 92
92 WillBeHeapHashMap<String, RawPtrWillBeMember<Element>> m_linkedDestinations; 93 WillBeHeapHashMap<String, RawPtrWillBeMember<Element>> m_linkedDestinations;
93 bool m_linkedDestinationsValid; 94 bool m_linkedDestinationsValid;
94 }; 95 };
95 96
96 } 97 }
97 98
98 #endif 99 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/PrintContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698