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

Unified Diff: Source/core/paint/GraphicsContextRecorder.h

Issue 718943003: Rename updateIntrinsicContentLogicalHeight to setIntrinsicContentLogicalHeight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tryin' again Created 6 years 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
« no previous file with comments | « Source/core/paint/ClipRecorder.cpp ('k') | Source/core/paint/GraphicsContextRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/GraphicsContextRecorder.h
diff --git a/Source/core/paint/GraphicsContextRecorder.h b/Source/core/paint/GraphicsContextRecorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ddac7b832e5fb2e459bc855e315e38c9eca4710
--- /dev/null
+++ b/Source/core/paint/GraphicsContextRecorder.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GraphicsContextRecorder_h
+#define GraphicsContextRecorder_h
+
+#include "core/paint/ClipRecorder.h"
+#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+
+namespace blink {
+
+class GraphicsContextRecorder {
+ STACK_ALLOCATED();
+public:
+ static GraphicsContextRecorder& currentRecorder() { return *s_currentRecorder; }
+
+ GraphicsContextRecorder(GraphicsContext& context, bool saveAndRestore = true)
+ : m_stateSaver(context, saveAndRestore)
+ , m_parent(s_currentRecorder)
+ {
+ s_currentRecorder = this;
+ }
+
+ ~GraphicsContextRecorder()
+ {
+ ASSERT(s_currentRecorder == this);
+ s_currentRecorder = m_parent;
+ }
+
+ void addClipRecorder(PassOwnPtr<ClipRecorder> clipRecorder)
+ {
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
+ m_clipRecorders.append(clipRecorder);
+ }
+private:
+ GraphicsContextStateSaver m_stateSaver;
+ GraphicsContextRecorder* m_parent;
+ Vector<OwnPtr<ClipRecorder>> m_clipRecorders;
+
+ static GraphicsContextRecorder* s_currentRecorder;
+};
+
+} // namespace blink
+
+#endif // GraphicsContextRecorder_h
« no previous file with comments | « Source/core/paint/ClipRecorder.cpp ('k') | Source/core/paint/GraphicsContextRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698