OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 15 matching lines...) Expand all Loading... | |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "config.h" | 32 #include "config.h" |
33 #include "core/rendering/GraphicsContextAnnotator.h" | 33 #include "core/rendering/GraphicsContextAnnotator.h" |
34 | 34 |
35 #include "core/inspector/InspectorNodeIds.h" | 35 #include "core/inspector/InspectorNodeIds.h" |
36 #include "core/inspector/InspectorTraceEvents.h" | |
36 #include "core/rendering/PaintInfo.h" | 37 #include "core/rendering/PaintInfo.h" |
37 #include "core/rendering/RenderObject.h" | 38 #include "core/rendering/RenderObject.h" |
38 #include "platform/graphics/GraphicsContextAnnotation.h" | 39 #include "platform/graphics/GraphicsContextAnnotation.h" |
39 #include "wtf/text/StringBuilder.h" | 40 #include "wtf/text/StringBuilder.h" |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
43 const char AnnotationKeyRendererName[] = "RENDERER"; | 44 const char AnnotationKeyRendererName[] = "RENDERER"; |
44 const char AnnotationKeyPaintPhase[] = "PHASE"; | 45 const char AnnotationKeyPaintPhase[] = "PHASE"; |
45 const char AnnotationKeyElementId[] = "ID"; | 46 const char AnnotationKeyElementId[] = "ID"; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 default: | 80 default: |
80 ASSERT_NOT_REACHED(); | 81 ASSERT_NOT_REACHED(); |
81 return "<unknown>"; | 82 return "<unknown>"; |
82 } | 83 } |
83 } | 84 } |
84 | 85 |
85 } | 86 } |
86 | 87 |
87 namespace blink { | 88 namespace blink { |
88 | 89 |
90 // FIXME: Introduce a real paint API instead of piggybacking on GraphicsContextA nnotator. | |
91 void GraphicsContextAnnotator::trackPaintInvalidation(const PaintInfo&, RenderOb ject* renderer) | |
92 { | |
93 TRACE_EVENT_INSTANT1( | |
94 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.paintInvalidationTracking") , | |
95 "PaintInvalidationTracking", | |
96 "data", | |
97 InspectorPaintInvalidationTrackingEvent::data(renderer)); | |
caseq
2014/08/26 12:19:07
Why do we need this? We already have nodeId in the
| |
98 } | |
99 | |
89 void GraphicsContextAnnotator::annotate(const PaintInfo& paintInfo, const Render Object* object) | 100 void GraphicsContextAnnotator::annotate(const PaintInfo& paintInfo, const Render Object* object) |
90 { | 101 { |
91 ASSERT(!m_context); | 102 ASSERT(!m_context); |
92 | 103 |
93 ASSERT(paintInfo.context); | 104 ASSERT(paintInfo.context); |
94 ASSERT(object); | 105 ASSERT(object); |
95 | 106 |
96 AnnotationList annotations; | 107 AnnotationList annotations; |
97 AnnotationModeFlags mode = paintInfo.context->annotationMode(); | 108 AnnotationModeFlags mode = paintInfo.context->annotationMode(); |
98 Element* element = object->node() && object->node()->isElementNode() ? toEle ment(object->node()) : 0; | 109 Element* element = object->node() && object->node()->isElementNode() ? toEle ment(object->node()) : 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 m_context->beginAnnotation(annotations); | 145 m_context->beginAnnotation(annotations); |
135 } | 146 } |
136 | 147 |
137 void GraphicsContextAnnotator::finishAnnotation() | 148 void GraphicsContextAnnotator::finishAnnotation() |
138 { | 149 { |
139 ASSERT(m_context); | 150 ASSERT(m_context); |
140 m_context->endAnnotation(); | 151 m_context->endAnnotation(); |
141 } | 152 } |
142 | 153 |
143 } // namespace blink | 154 } // namespace blink |
OLD | NEW |