| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "services/gfx/compositor/graph/snapshot.h" | 5 #include "services/gfx/compositor/graph/snapshot.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/skia/type_converters.h" | 8 #include "mojo/skia/type_converters.h" |
| 9 #include "services/gfx/compositor/graph/scene_content.h" | 9 #include "services/gfx/compositor/graph/scene_content.h" |
| 10 #include "services/gfx/compositor/graph/scene_def.h" | 10 #include "services/gfx/compositor/graph/scene_def.h" |
| 11 #include "services/gfx/compositor/render/render_frame.h" | 11 #include "services/gfx/compositor/render/render_frame.h" |
| 12 #include "third_party/skia/include/core/SkMatrix.h" | |
| 13 #include "third_party/skia/include/core/SkPictureRecorder.h" | 12 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 14 #include "third_party/skia/include/core/SkRect.h" | 13 #include "third_party/skia/include/core/SkRect.h" |
| 14 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 15 | 15 |
| 16 namespace compositor { | 16 namespace compositor { |
| 17 | 17 |
| 18 Snapshot::Snapshot() {} | 18 Snapshot::Snapshot() {} |
| 19 | 19 |
| 20 Snapshot::~Snapshot() {} | 20 Snapshot::~Snapshot() {} |
| 21 | 21 |
| 22 bool Snapshot::HasDependency(const SceneDef* scene) const { | 22 bool Snapshot::HasDependency(const SceneDef* scene) const { |
| 23 return dependencies_.find(scene->label().token()) != dependencies_.end(); | 23 return dependencies_.find(scene->label().token()) != dependencies_.end(); |
| 24 } | 24 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 return RenderFrame::Create(skia::AdoptRef(recorder.endRecordingAsPicture()), | 37 return RenderFrame::Create(skia::AdoptRef(recorder.endRecordingAsPicture()), |
| 38 sk_viewport, frame_info); | 38 sk_viewport, frame_info); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void Snapshot::HitTest(const mojo::PointF& point, | 41 void Snapshot::HitTest(const mojo::PointF& point, |
| 42 mojo::gfx::composition::HitTestResult* result) const { | 42 mojo::gfx::composition::HitTestResult* result) const { |
| 43 DCHECK(result); | 43 DCHECK(result); |
| 44 DCHECK(!is_blocked()); | 44 DCHECK(!is_blocked()); |
| 45 DCHECK(root_scene_content_); | 45 DCHECK(root_scene_content_); |
| 46 | 46 |
| 47 root_scene_content_->HitTest(this, point.To<SkPoint>(), SkMatrix::I(), | 47 root_scene_content_->HitTest(this, point.To<SkPoint>(), SkMatrix44::I(), |
| 48 &result->root); | 48 &result->root); |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool Snapshot::IsNodeBlocked(const NodeDef* node) const { | 51 bool Snapshot::IsNodeBlocked(const NodeDef* node) const { |
| 52 DCHECK(!is_blocked()); | 52 DCHECK(!is_blocked()); |
| 53 | 53 |
| 54 auto it = node_dispositions_.find(node); | 54 auto it = node_dispositions_.find(node); |
| 55 DCHECK(it != node_dispositions_.end()); | 55 DCHECK(it != node_dispositions_.end()); |
| 56 DCHECK(it->second == Disposition::kSuccess || | 56 DCHECK(it->second == Disposition::kSuccess || |
| 57 it->second == Disposition::kBlocked); | 57 it->second == Disposition::kBlocked); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 if (snapshot_->is_blocked()) { | 214 if (snapshot_->is_blocked()) { |
| 215 snapshot_->root_scene_content_ = nullptr; | 215 snapshot_->root_scene_content_ = nullptr; |
| 216 snapshot_->resolved_scene_contents_.clear(); | 216 snapshot_->resolved_scene_contents_.clear(); |
| 217 snapshot_->node_dispositions_.clear(); | 217 snapshot_->node_dispositions_.clear(); |
| 218 } | 218 } |
| 219 return std::move(snapshot_); | 219 return std::move(snapshot_); |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace compositor | 222 } // namespace compositor |
| OLD | NEW |