| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 13 matching lines...) Expand all Loading... |
| 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 #ifndef GraphicsLayerDebugInfo_h | 31 #ifndef GraphicsLayerDebugInfo_h |
| 32 #define GraphicsLayerDebugInfo_h | 32 #define GraphicsLayerDebugInfo_h |
| 33 | 33 |
| 34 #include "base/memory/ref_counted.h" | 34 #include "platform/JSONValues.h" |
| 35 #include "platform/geometry/FloatRect.h" | 35 #include "platform/geometry/FloatRect.h" |
| 36 #include "platform/graphics/CompositingReasons.h" | 36 #include "platform/graphics/CompositingReasons.h" |
| 37 #include "platform/graphics/PaintInvalidationReason.h" | 37 #include "platform/graphics/PaintInvalidationReason.h" |
| 38 #include "public/platform/WebGraphicsLayerDebugInfo.h" |
| 39 |
| 38 #include "wtf/Vector.h" | 40 #include "wtf/Vector.h" |
| 39 | 41 |
| 40 namespace base { | |
| 41 namespace trace_event { | |
| 42 class TracedValue; | |
| 43 } | |
| 44 } | |
| 45 | |
| 46 namespace blink { | 42 namespace blink { |
| 47 | 43 |
| 48 class GraphicsLayerDebugInfo { | 44 class GraphicsLayerDebugInfo final : public WebGraphicsLayerDebugInfo { |
| 49 public: | 45 public: |
| 50 GraphicsLayerDebugInfo(); | 46 GraphicsLayerDebugInfo(); |
| 51 ~GraphicsLayerDebugInfo(); | 47 ~GraphicsLayerDebugInfo() override; |
| 52 | 48 |
| 53 scoped_refptr<base::trace_event::TracedValue> asTracedValue() const; | 49 void appendAsTraceFormat(WebString* out) const override; |
| 54 | 50 |
| 51 GraphicsLayerDebugInfo* clone() const; |
| 52 |
| 53 void setDebugName(const String& name) { m_debugName = name; } |
| 55 CompositingReasons compositingReasons() const { return m_compositingReasons;
} | 54 CompositingReasons compositingReasons() const { return m_compositingReasons;
} |
| 56 void setCompositingReasons(CompositingReasons reasons) { m_compositingReason
s = reasons; } | 55 void setCompositingReasons(CompositingReasons reasons) { m_compositingReason
s = reasons; } |
| 57 void setOwnerNodeId(int id) { m_ownerNodeId = id; } | 56 void setOwnerNodeId(int id) { m_ownerNodeId = id; } |
| 58 | 57 |
| 59 void appendAnnotatedInvalidateRect(const FloatRect&, PaintInvalidationReason
); | 58 void appendAnnotatedInvalidateRect(const FloatRect&, PaintInvalidationReason
); |
| 60 void clearAnnotatedInvalidateRects(); | 59 void clearAnnotatedInvalidateRects(); |
| 61 | 60 |
| 62 private: | 61 private: |
| 63 void appendAnnotatedInvalidateRects(base::trace_event::TracedValue*) const; | 62 void appendAnnotatedInvalidateRects(JSONObject*) const; |
| 64 void appendCompositingReasons(base::trace_event::TracedValue*) const; | 63 void appendCompositingReasons(JSONObject*) const; |
| 65 void appendOwnerNodeId(base::trace_event::TracedValue*) const; | 64 void appendDebugName(JSONObject*) const; |
| 65 void appendOwnerNodeId(JSONObject*) const; |
| 66 | 66 |
| 67 struct AnnotatedInvalidationRect { | 67 struct AnnotatedInvalidationRect { |
| 68 FloatRect rect; | 68 FloatRect rect; |
| 69 PaintInvalidationReason reason; | 69 PaintInvalidationReason reason; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 String m_debugName; |
| 72 CompositingReasons m_compositingReasons; | 73 CompositingReasons m_compositingReasons; |
| 73 int m_ownerNodeId; | 74 int m_ownerNodeId; |
| 74 Vector<AnnotatedInvalidationRect> m_invalidations; | 75 Vector<AnnotatedInvalidationRect> m_invalidations; |
| 75 Vector<AnnotatedInvalidationRect> m_previousInvalidations; | 76 Vector<AnnotatedInvalidationRect> m_previousInvalidations; |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace blink | 79 } // namespace blink |
| 79 | 80 |
| 80 #endif | 81 #endif |
| OLD | NEW |