| 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 "platform/JSONValues.h" | 34 #include "base/memory/ref_counted.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" | 38 #include "wtf/Vector.h" |
| 39 | 39 |
| 40 #include "wtf/Vector.h" | 40 namespace base { |
| 41 namespace trace_event { |
| 42 class TracedValue; |
| 43 } |
| 44 } |
| 41 | 45 |
| 42 namespace blink { | 46 namespace blink { |
| 43 | 47 |
| 44 class GraphicsLayerDebugInfo final : public WebGraphicsLayerDebugInfo { | 48 class GraphicsLayerDebugInfo { |
| 45 public: | 49 public: |
| 46 GraphicsLayerDebugInfo(); | 50 GraphicsLayerDebugInfo(); |
| 47 ~GraphicsLayerDebugInfo() override; | 51 ~GraphicsLayerDebugInfo(); |
| 48 | 52 |
| 49 void appendAsTraceFormat(WebString* out) const override; | 53 scoped_refptr<base::trace_event::TracedValue> asTracedValue() const; |
| 50 | 54 |
| 51 GraphicsLayerDebugInfo* clone() const; | |
| 52 | |
| 53 void setDebugName(const String& name) { m_debugName = name; } | |
| 54 CompositingReasons compositingReasons() const { return m_compositingReasons;
} | 55 CompositingReasons compositingReasons() const { return m_compositingReasons;
} |
| 55 void setCompositingReasons(CompositingReasons reasons) { m_compositingReason
s = reasons; } | 56 void setCompositingReasons(CompositingReasons reasons) { m_compositingReason
s = reasons; } |
| 56 void setOwnerNodeId(int id) { m_ownerNodeId = id; } | 57 void setOwnerNodeId(int id) { m_ownerNodeId = id; } |
| 57 | 58 |
| 58 void appendAnnotatedInvalidateRect(const FloatRect&, PaintInvalidationReason
); | 59 void appendAnnotatedInvalidateRect(const FloatRect&, PaintInvalidationReason
); |
| 59 void clearAnnotatedInvalidateRects(); | 60 void clearAnnotatedInvalidateRects(); |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 void appendAnnotatedInvalidateRects(JSONObject*) const; | 63 void appendAnnotatedInvalidateRects(base::trace_event::TracedValue*) const; |
| 63 void appendCompositingReasons(JSONObject*) const; | 64 void appendCompositingReasons(base::trace_event::TracedValue*) const; |
| 64 void appendDebugName(JSONObject*) const; | 65 void appendOwnerNodeId(base::trace_event::TracedValue*) 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; | |
| 73 CompositingReasons m_compositingReasons; | 72 CompositingReasons m_compositingReasons; |
| 74 int m_ownerNodeId; | 73 int m_ownerNodeId; |
| 75 Vector<AnnotatedInvalidationRect> m_invalidations; | 74 Vector<AnnotatedInvalidationRect> m_invalidations; |
| 76 Vector<AnnotatedInvalidationRect> m_previousInvalidations; | 75 Vector<AnnotatedInvalidationRect> m_previousInvalidations; |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 } // namespace blink | 78 } // namespace blink |
| 80 | 79 |
| 81 #endif | 80 #endif |
| OLD | NEW |