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

Unified Diff: Source/core/rendering/GraphicsContextAnnotator.h

Issue 55223002: Remove rendering dependency in GraphicsContextAnnotation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for relanding Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/GraphicsContextAnnotator.h
diff --git a/Source/core/dom/ParentNode.h b/Source/core/rendering/GraphicsContextAnnotator.h
similarity index 67%
copy from Source/core/dom/ParentNode.h
copy to Source/core/rendering/GraphicsContextAnnotator.h
index 9fb949a35b0aefb308f11af7253806ad7167cbe8..5d0936e551e5e3df46960cb7ff95ac2bc47d1b02 100644
--- a/Source/core/dom/ParentNode.h
+++ b/Source/core/rendering/GraphicsContextAnnotator.h
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,36 +29,40 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ParentNode_h
-#define ParentNode_h
+#ifndef GraphicsContextAnnotator_h
+#define GraphicsContextAnnotator_h
-#include "core/dom/ContainerNode.h"
+#define ANNOTATE_GRAPHICS_CONTEXT(paintInfo, renderer) \
+ GraphicsContextAnnotator scopedGraphicsContextAnnotator; \
+ if (UNLIKELY(paintInfo.context->annotationMode())) \
+ scopedGraphicsContextAnnotator.annotate(paintInfo, renderer)
namespace WebCore {
-class ParentNode {
+class GraphicsContext;
+struct PaintInfo;
+class RenderObject;
+
+class GraphicsContextAnnotator {
public:
- static PassRefPtr<HTMLCollection> children(ContainerNode* node)
- {
- return node->children();
- }
+ GraphicsContextAnnotator()
+ : m_context(0)
+ { }
- static Element* firstElementChild(ContainerNode* node)
+ ~GraphicsContextAnnotator()
{
- return node->firstElementChild();
+ if (UNLIKELY(m_context != 0))
+ finishAnnotation();
}
- static Element* lastElementChild(ContainerNode* node)
- {
- return node->lastElementChild();
- }
+ void annotate(const PaintInfo&, const RenderObject*);
- static unsigned childElementCount(ContainerNode* node)
- {
- return node->childElementCount();
- }
+private:
+ void finishAnnotation();
+
+ GraphicsContext* m_context;
};
} // namespace WebCore
-#endif // ParentNode_h
+#endif // GraphicsContextAnnotator_h
« no previous file with comments | « Source/core/platform/graphics/GraphicsContextAnnotation.cpp ('k') | Source/core/rendering/GraphicsContextAnnotator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698