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

Unified Diff: services/gfx/compositor/graph/scene_content.h

Issue 1774373002: Mozart: Implement hit testing. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-4
Patch Set: Created 4 years, 9 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
« no previous file with comments | « services/gfx/compositor/graph/node_def.cc ('k') | services/gfx/compositor/graph/scene_content.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gfx/compositor/graph/scene_content.h
diff --git a/services/gfx/compositor/graph/scene_content.h b/services/gfx/compositor/graph/scene_content.h
index f3ccb5abafb5b6cf836ad3d2edf1801929dbdaa0..60777633a9ae3544c82b784de2b0bc9f910530c7 100644
--- a/services/gfx/compositor/graph/scene_content.h
+++ b/services/gfx/compositor/graph/scene_content.h
@@ -11,11 +11,16 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "mojo/services/gfx/composition/interfaces/hit_tests.mojom.h"
#include "mojo/services/gfx/composition/interfaces/scenes.mojom.h"
#include "services/gfx/compositor/graph/node_def.h"
#include "services/gfx/compositor/graph/resource_def.h"
#include "services/gfx/compositor/graph/scene_label.h"
+class SkCanvas;
+struct SkPoint;
+class SkMatrix;
+
namespace compositor {
class SceneContentBuilder;
@@ -49,6 +54,20 @@ class SceneContent : public base::RefCounted<SceneContent> {
// Gets the version of the scene represented by this object.
uint32_t version() const { return version_; }
+ // Called to record drawing commands from a snapshot.
+ void RecordPicture(const Snapshot* snapshot, SkCanvas* canvas) const;
+
+ // Performs a hit test at the specified point.
+ // The |scene_point| is the hit tested point in the scene's coordinate space.
+ // The |global_to_scene_transform| is the accumulated transform from the
+ // global coordinate space to the scene's coordinate space.
+ // Provides hit information for the scene in |out_scene_hit| if any.
+ // Returns true if the search was terminated by an opaque hit.
+ bool HitTest(const Snapshot* snapshot,
+ const SkPoint& scene_point,
+ const SkMatrix& global_to_scene_transform,
+ mojo::gfx::composition::SceneHitPtr* out_scene_hit) const;
+
// Gets the requested resource, never null because it must be present.
const ResourceDef* GetResource(uint32_t resource_id,
ResourceDef::Type resource_type) const;
« no previous file with comments | « services/gfx/compositor/graph/node_def.cc ('k') | services/gfx/compositor/graph/scene_content.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698