Skip to content

Commit

Permalink
[fuchsia] Updated scenic fidl prefix (flutter#4798)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejurka authored Mar 16, 2018
1 parent c24e285 commit ac7b81f
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 31 deletions.
21 changes: 10 additions & 11 deletions content_handler/session_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SessionConnection::SessionConnection(ui::ScenicPtr scenic,
this, std::placeholders::_1));

root_node_.Bind(std::move(import_token));
root_node_.SetEventMask(scenic::kMetricsEventMask);
root_node_.SetEventMask(ui::gfx::kMetricsEventMask);
session_.Present(0, [](ui::PresentationInfoPtr info) {});

present_callback_ =
Expand All @@ -38,13 +38,12 @@ void SessionConnection::OnSessionError() {
FXL_CHECK(false) << "Session connection was terminated.";
}

void SessionConnection::OnSessionEvents(
f1dl::Array<ui::EventPtr> events) {
scenic::MetricsPtr new_metrics;
void SessionConnection::OnSessionEvents(f1dl::Array<ui::EventPtr> events) {
ui::gfx::MetricsPtr new_metrics;
for (const auto& event : events) {
if (event->is_scenic() && event->get_scenic()->is_metrics() &&
event->get_scenic()->get_metrics()->node_id == root_node_.id()) {
new_metrics = std::move(event->get_scenic()->get_metrics()->metrics);
if (event->is_gfx() && event->get_gfx()->is_metrics() &&
event->get_gfx()->get_metrics()->node_id == root_node_.id()) {
new_metrics = std::move(event->get_gfx()->get_metrics()->metrics);
}
}
if (!new_metrics)
Expand Down Expand Up @@ -78,7 +77,7 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame,
surface_producer_->OnSurfacesPresented(std::move(surfaces_to_submit));

// Prepare for the next frame.
EnqueueClearOps();
EnqueueClearCommands();
}

void SessionConnection::OnPresent(ui::PresentationInfoPtr info) {
Expand All @@ -88,11 +87,11 @@ void SessionConnection::OnPresent(ui::PresentationInfoPtr info) {
callback();
}

void SessionConnection::EnqueueClearOps() {
void SessionConnection::EnqueueClearCommands() {
ASSERT_IS_GPU_THREAD;
// We are going to be sending down a fresh node hierarchy every frame. So just
// enqueue a detach op on the imported root node.
session_.Enqueue(scenic_lib::NewDetachChildrenOp(root_node_.id()));
// enqueue a detach command on the imported root node.
session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id()));
}

} // namespace flutter_runner
4 changes: 2 additions & 2 deletions content_handler/session_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SessionConnection {

bool has_metrics() const { return scene_update_context_.has_metrics(); }

const scenic::MetricsPtr& metrics() const {
const ui::gfx::MetricsPtr& metrics() const {
return scene_update_context_.metrics();
}

Expand Down Expand Up @@ -58,7 +58,7 @@ class SessionConnection {
void OnSessionError();
void OnSessionEvents(f1dl::Array<ui::EventPtr> events);

void EnqueueClearOps();
void EnqueueClearCommands();

void OnPresent(ui::PresentationInfoPtr info);

Expand Down
10 changes: 5 additions & 5 deletions content_handler/vulkan_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session,
}

scenic_lib::Memory memory(session, std::move(exported_vmo),
scenic::MemoryType::VK_DEVICE_MEMORY);
ui::gfx::MemoryType::VK_DEVICE_MEMORY);

auto image_info = scenic::ImageInfo::New();
auto image_info = ui::gfx::ImageInfo::New();
image_info->width = sk_surface_->width();
image_info->height = sk_surface_->height();
image_info->stride = 4 * sk_surface_->width();
image_info->pixel_format = scenic::ImageInfo::PixelFormat::BGRA_8;
image_info->color_space = scenic::ImageInfo::ColorSpace::SRGB;
image_info->tiling = scenic::ImageInfo::Tiling::LINEAR;
image_info->pixel_format = ui::gfx::ImageInfo::PixelFormat::BGRA_8;
image_info->color_space = ui::gfx::ImageInfo::ColorSpace::SRGB;
image_info->tiling = ui::gfx::ImageInfo::Tiling::LINEAR;

session_image_ = std::make_unique<scenic_lib::Image>(
memory, 0 /* memory offset */, std::move(image_info));
Expand Down
4 changes: 2 additions & 2 deletions flow/export_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void ExportNode::Bind(SceneUpdateContext& context,
container.AddChild(*node_);
node_->SetTranslation(offset.x(), offset.y(), 0.f);
node_->SetHitTestBehavior(hit_testable
? scenic::HitTestBehavior::kDefault
: scenic::HitTestBehavior::kSuppress);
? ui::gfx::HitTestBehavior::kDefault
: ui::gfx::HitTestBehavior::kSuppress);
}
}

Expand Down
2 changes: 1 addition & 1 deletion flow/layers/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Layer {

struct PrerollContext {
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics = nullptr;
ui::gfx::Metrics* metrics = nullptr;
#endif
RasterCache* raster_cache;
GrContext* gr_context;
Expand Down
4 changes: 2 additions & 2 deletions flow/layers/layer_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ LayerTree::~LayerTree() = default;

void LayerTree::Raster(CompositorContext::ScopedFrame& frame,
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics,
ui::gfx::Metrics* metrics,
#endif
bool ignore_raster_cache) {
#if defined(OS_FUCHSIA)
Expand All @@ -35,7 +35,7 @@ void LayerTree::Raster(CompositorContext::ScopedFrame& frame,

void LayerTree::Preroll(CompositorContext::ScopedFrame& frame,
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics,
ui::gfx::Metrics* metrics,
#endif
bool ignore_raster_cache) {
#if defined(OS_FUCHSIA)
Expand Down
4 changes: 2 additions & 2 deletions flow/layers/layer_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class LayerTree {
// Raster includes both Preroll and Paint.
void Raster(CompositorContext::ScopedFrame& frame,
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics,
ui::gfx::Metrics* metrics,
#endif
bool ignore_raster_cache = false);

void Preroll(CompositorContext::ScopedFrame& frame,
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics,
ui::gfx::Metrics* metrics,
#endif
bool ignore_raster_cache = false);

Expand Down
4 changes: 2 additions & 2 deletions flow/raster_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RasterCacheResult RasterizePicture(SkPicture* picture,
const MatrixDecomposition& matrix,
SkColorSpace* dst_color_space,
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics,
ui::gfx::Metrics* metrics,
#endif
bool checkerboard) {
TRACE_EVENT0("flutter", "RasterCachePopulate");
Expand Down Expand Up @@ -154,7 +154,7 @@ RasterCacheResult RasterCache::GetPrerolledImage(
const SkMatrix& transformation_matrix,
SkColorSpace* dst_color_space,
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics,
ui::gfx::Metrics* metrics,
#endif
bool is_complex,
bool will_change) {
Expand Down
2 changes: 1 addition & 1 deletion flow/raster_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RasterCache {
const SkMatrix& transformation_matrix,
SkColorSpace* dst_color_space,
#if defined(OS_FUCHSIA)
scenic::Metrics* metrics,
ui::gfx::Metrics* metrics,
#endif
bool is_complex,
bool will_change);
Expand Down
6 changes: 3 additions & 3 deletions flow/scene_update_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ class SceneUpdateContext {
scenic_lib::Session* session() { return session_; }

bool has_metrics() const { return !!metrics_; }
void set_metrics(scenic::MetricsPtr metrics) {
void set_metrics(ui::gfx::MetricsPtr metrics) {
metrics_ = std::move(metrics);
}
const scenic::MetricsPtr& metrics() const { return metrics_; }
const ui::gfx::MetricsPtr& metrics() const { return metrics_; }

void AddChildScene(ExportNode* export_node,
SkPoint offset,
Expand Down Expand Up @@ -181,7 +181,7 @@ class SceneUpdateContext {
scenic_lib::Session* const session_;
SurfaceProducer* const surface_producer_;

scenic::MetricsPtr metrics_;
ui::gfx::MetricsPtr metrics_;

std::vector<PaintTask> paint_tasks_;

Expand Down

0 comments on commit ac7b81f

Please sign in to comment.