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

Unified Diff: cc/trees/occlusion_checker.h

Issue 547723002: Reland of: cc: Add occlusion checker as a fixed view of occlusion tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with test? Created 6 years, 3 months 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: cc/trees/occlusion_checker.h
diff --git a/cc/trees/occlusion_checker.h b/cc/trees/occlusion_checker.h
new file mode 100644
index 0000000000000000000000000000000000000000..ffcccdfa262eee9eb4050d07bf024caf1b276cce
--- /dev/null
+++ b/cc/trees/occlusion_checker.h
@@ -0,0 +1,45 @@
+// 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 CC_TREES_OCCLUSION_CHECKER_H_
+#define CC_TREES_OCCLUSION_CHECKER_H_
+
+#include "base/basictypes.h"
+#include "cc/base/cc_export.h"
+#include "cc/base/simple_enclosed_region.h"
+#include "ui/gfx/rect.h"
+#include "ui/gfx/transform.h"
+
+namespace cc {
+class LayerImpl;
+class Layer;
+template <typename LayerType>
+class OcclusionTracker;
+
+template <typename LayerType>
danakj 2014/09/09 15:14:39 i don't see why this class is templated, can we re
vmpstr 2014/09/09 21:56:56 Makes sense, I went overzealous with making it loo
+class CC_EXPORT OcclusionChecker {
+ public:
+ OcclusionChecker();
+
+ bool Occluded(const gfx::Rect& content_rect) const;
+
+ private:
+ friend class OcclusionTracker<LayerType>;
+ OcclusionChecker(const gfx::Transform& draw_transform,
+ const SimpleEnclosedRegion& occlusion_from_outside_target,
+ const SimpleEnclosedRegion& occlusion_from_inside_target);
+
+ gfx::Transform draw_transform_;
+ SimpleEnclosedRegion occlusion_from_outside_target_;
+ SimpleEnclosedRegion occlusion_from_inside_target_;
+};
+
+#if !defined(COMPILER_MSVC)
+extern template class OcclusionChecker<Layer>;
+extern template class OcclusionChecker<LayerImpl>;
+#endif
+
+} // namespace cc
+
+#endif // CC_TREES_OCCLUSION_CHECKER_H_

Powered by Google App Engine
This is Rietveld 408576698