Index: cc/output/bsp_walk_action.h |
diff --git a/cc/output/bsp_walk_action.h b/cc/output/bsp_walk_action.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..073db1ddf9b3299d5c59a23f4a080d3994cbc299 |
--- /dev/null |
+++ b/cc/output/bsp_walk_action.h |
@@ -0,0 +1,54 @@ |
+// Copyright 2013 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 CC_OUTPUT_BSP_WALK_ACTION_H_ |
+#define CC_OUTPUT_BSP_WALK_ACTION_H_ |
+ |
+#include <vector> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "cc/output/direct_renderer.h" |
+#include "cc/quads/draw_polygon.h" |
+ |
+namespace cc { |
+ |
+template <typename T> |
+class BspWalkAction { |
+ public: |
+ virtual void operator()(T* item) = 0; |
+}; |
+ |
+// Currently commented out because DoDrawPolygon is not a part of |
+// DirectRenderer yet. That will come in a later patch. |
+/* class BspWalkActionDrawPolygon : public BspWalkAction<DrawPolygon> { |
+ public: |
+ virtual void operator()(DrawPolygon& item) OVERRIDE { |
+ // Here's where we do work! |
+ gfx::Transform inverse_transform; |
+ item.GetInverseTransform(&inverse_transform); |
+ item.ApplyTransform(inverse_transform); |
+ renderer_.DoDrawPolygon(item, frame_); |
+ } |
+ |
+ BspWalkActionDrawPolygon(DirectRenderer& renderer, |
+ DirectRenderer::DrawingFrame* frame) |
+ : renderer_(renderer), frame_(frame) {} |
+ |
+ private: |
+ DirectRenderer& renderer_; |
+ DirectRenderer::DrawingFrame* frame_; |
+}; */ |
+ |
+class BspWalkActionToVector : public BspWalkAction<DrawPolygon> { |
+ public: |
+ explicit BspWalkActionToVector(std::vector<DrawPolygon*>* in_list); |
+ virtual void operator()(DrawPolygon* item)OVERRIDE; |
+ |
+ private: |
+ std::vector<DrawPolygon*>* list_; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_OUTPUT_BSP_WALK_ACTION_H_ |