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

Unified Diff: cc/surfaces/surface_hittest.h

Issue 1265013003: Adds support for hittesting points on surface quads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: recursing into RenderPassDrawQuads, checking for clipped_rect, checking for occluded quads Created 5 years, 4 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/surfaces/surface_hittest.h
diff --git a/cc/surfaces/surface_hittest.h b/cc/surfaces/surface_hittest.h
new file mode 100644
index 0000000000000000000000000000000000000000..e7d13f25608f1482ba38f701ab8c6489ed54ff39
--- /dev/null
+++ b/cc/surfaces/surface_hittest.h
@@ -0,0 +1,45 @@
+// Copyright 2015 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_SURFACES_SURFACE_HITTEST_H_
+#define CC_SURFACES_SURFACE_HITTEST_H_
+
+#include <set>
+
+#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surfaces_export.h"
+
+namespace gfx {
+class Point;
+}
+
+namespace cc {
+class RenderPass;
+class SurfaceManager;
+
+// Performs a hittest in surface quads.
+class CC_SURFACES_EXPORT SurfaceHittest {
+ public:
+ explicit SurfaceHittest(SurfaceManager* manager);
+ ~SurfaceHittest();
+
+ // Hittests against Surface with SurfaceId |surface_id|, return the contained
+ // surface that the point is hitting and the |transformed_point| in the
+ // surface space.
+ SurfaceId Hittest(SurfaceId surface_id,
+ const gfx::Point& point,
+ gfx::Point* transformed_point);
+
+ private:
+ SurfaceId HittestInternal(SurfaceId surface_id,
+ const RenderPass* render_pass,
+ const gfx::Point& point,
+ gfx::Point* out_transformed_point);
+
+ SurfaceManager* const manager_;
+ std::set<SurfaceId> referenced_surfaces_;
+};
+} // namespace cc
+
+#endif // CC_SURFACES_SURFACE_HITTEST_H_

Powered by Google App Engine
This is Rietveld 408576698