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

Side by Side Diff: Source/core/platform/graphics/GraphicsContextAnnotation.h

Issue 18551004: Miscellaneous cleanup to reduce number of includes in platform/graphics/ Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/platform/graphics/AnnotationMode.h"
31 #include "wtf/Vector.h" 32 #include "wtf/Vector.h"
32 #include "wtf/text/WTFString.h" 33 #include "wtf/text/WTFString.h"
33 34
34 #ifndef GraphicsContextAnnotation_h 35 #ifndef GraphicsContextAnnotation_h
35 #define GraphicsContextAnnotation_h 36 #define GraphicsContextAnnotation_h
36 37
37 #define ANNOTATE_GRAPHICS_CONTEXT(paintInfo, renderer) \ 38 #define ANNOTATE_GRAPHICS_CONTEXT(paintInfo, renderer) \
38 GraphicsContextAnnotator scopedGraphicsContextAnnotator; \ 39 GraphicsContextAnnotator scopedGraphicsContextAnnotator; \
39 if (UNLIKELY(paintInfo.context->annotationMode())) \ 40 if (UNLIKELY(paintInfo.context->annotationMode())) \
40 scopedGraphicsContextAnnotator.annotate(paintInfo, renderer) 41 scopedGraphicsContextAnnotator.annotate(paintInfo, renderer)
41 42
42 namespace WebCore { 43 namespace WebCore {
43 44
44 class GraphicsContext; 45 class GraphicsContext;
45 class RenderObject; 46 class RenderObject;
46 struct PaintInfo; 47 struct PaintInfo;
47 48
48 enum AnnotationMode {
49 AnnotateRendererName = 1 << 0,
50 AnnotatePaintPhase = 1 << 1,
51 AnnotateElementId = 1 << 2,
52 AnnotateElementClass = 1 << 3,
53 AnnotateElementTag = 1 << 4,
54
55 AnnotateAll = 0x1f
56 };
57
58 typedef unsigned AnnotationModeFlags;
59 typedef Vector<std::pair<const char*, String> > AnnotationList; 49 typedef Vector<std::pair<const char*, String> > AnnotationList;
60 50
61 class GraphicsContextAnnotation { 51 class GraphicsContextAnnotation {
62 public: 52 public:
63 GraphicsContextAnnotation(const PaintInfo&, const RenderObject*); 53 GraphicsContextAnnotation(const PaintInfo&, const RenderObject*);
64 54
65 String rendererName() const { return ASCIILiteral(m_rendererName); } 55 String rendererName() const { return ASCIILiteral(m_rendererName); }
66 String paintPhase() const { return ASCIILiteral(m_paintPhase); } 56 String paintPhase() const { return ASCIILiteral(m_paintPhase); }
67 String elementId() const { return m_elementId; } 57 String elementId() const { return m_elementId; }
68 String elementClass() const { return m_elementClass; } 58 String elementClass() const { return m_elementClass; }
(...skipping 25 matching lines...) Expand all
94 84
95 private: 85 private:
96 void finishAnnotation(); 86 void finishAnnotation();
97 87
98 GraphicsContext* m_context; 88 GraphicsContext* m_context;
99 }; 89 };
100 90
101 } // namespace WebCore 91 } // namespace WebCore
102 92
103 #endif // GraphicsContextAnnotation_h 93 #endif // GraphicsContextAnnotation_h
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsContext.cpp ('k') | Source/core/platform/graphics/GraphicsContextState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698