Skip to content

Commit

Permalink
Format all c-like sources with clang-format (flutter#4088)
Browse files Browse the repository at this point in the history
* format

* license script adaptions

* updated licenses

* review comments
  • Loading branch information
goderbauer authored Sep 12, 2017
1 parent 7fd7ecd commit 08961f8
Show file tree
Hide file tree
Showing 709 changed files with 94,118 additions and 84,854 deletions.
2 changes: 1 addition & 1 deletion assets/zip_asset_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <string>
#include <utility>

#include "flutter/glue/trace_event.h"
#include "lib/fxl/files/eintr_wrapper.h"
#include "lib/fxl/files/unique_fd.h"
#include "flutter/glue/trace_event.h"
#include "lib/zip/unique_unzipper.h"

namespace blink {
Expand Down
2 changes: 1 addition & 1 deletion content_handler/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include "flutter/common/settings.h"
#include "flutter/common/threads.h"
#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h"
#include "lib/fsl/tasks/message_loop.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/tasks/task_runner.h"
#include "lib/icu_data/cpp/icu_data.h"
#include "lib/fsl/tasks/message_loop.h"

namespace flutter_runner {
namespace {
Expand Down
4 changes: 2 additions & 2 deletions content_handler/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include <memory>
#include <unordered_set>

#include "flutter/content_handler/application_controller_impl.h"
#include "lib/app/cpp/application_context.h"
#include "lib/app/fidl/application_runner.fidl.h"
#include "flutter/content_handler/application_controller_impl.h"
#include "lib/fsl/threading/thread.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/synchronization/waitable_event.h"
#include "lib/fsl/threading/thread.h"

namespace flutter_runner {

Expand Down
11 changes: 5 additions & 6 deletions content_handler/application_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include <magenta/status.h>
#include <mxio/namespace.h>

#include "lib/app/cpp/connect.h"
#include "flutter/content_handler/app.h"
#include "flutter/content_handler/runtime_holder.h"
#include "lib/fxl/logging.h"
#include "lib/app/cpp/connect.h"
#include "lib/fsl/vmo/vector.h"
#include "lib/fxl/logging.h"

namespace flutter_runner {

Expand Down Expand Up @@ -52,8 +52,8 @@ ApplicationControllerImpl::ApplicationControllerImpl(

service_provider_bridge_.AddService<mozart::ViewProvider>(
[this](fidl::InterfaceRequest<mozart::ViewProvider> request) {
view_provider_bindings_.AddBinding(this, std::move(request));
});
view_provider_bindings_.AddBinding(this, std::move(request));
});

app::ServiceProviderPtr service_provider;
auto request = service_provider.NewRequest();
Expand All @@ -67,8 +67,7 @@ ApplicationControllerImpl::ApplicationControllerImpl(
url_ = startup_info->launch_info->url;
runtime_holder_.reset(new RuntimeHolder());
runtime_holder_->Init(
mxio_ns,
app::ApplicationContext::CreateFrom(std::move(startup_info)),
mxio_ns, app::ApplicationContext::CreateFrom(std::move(startup_info)),
std::move(request), std::move(bundle));
}

Expand Down
6 changes: 3 additions & 3 deletions content_handler/application_controller_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

#include <mxio/namespace.h>

#include "lib/svc/cpp/service_provider_bridge.h"
#include "dart/runtime/include/dart_api.h"
#include "lib/app/fidl/application_controller.fidl.h"
#include "lib/app/fidl/application_runner.fidl.h"
#include "lib/app/fidl/service_provider.fidl.h"
#include "lib/ui/views/fidl/view_provider.fidl.h"
#include "dart/runtime/include/dart_api.h"
#include "lib/fidl/cpp/bindings/binding.h"
#include "lib/fidl/cpp/bindings/binding_set.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/synchronization/waitable_event.h"
#include "lib/svc/cpp/service_provider_bridge.h"
#include "lib/ui/views/fidl/view_provider.fidl.h"

namespace flutter_runner {
class App;
Expand Down
2 changes: 1 addition & 1 deletion content_handler/rasterizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#include <memory>

#include "lib/ui/scenic/fidl/session.fidl.h"
#include "flutter/flow/layers/layer_tree.h"
#include "lib/fxl/functional/closure.h"
#include "lib/fxl/macros.h"
#include "lib/ui/scenic/fidl/session.fidl.h"
#include "magenta/system/ulib/mx/include/mx/eventpair.h"

namespace flutter_runner {
Expand Down
14 changes: 7 additions & 7 deletions content_handler/runtime_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <mxio/namespace.h>
#include <utility>

#include "lib/app/cpp/connect.h"
#include "dart-pkg/zircon/sdk_ext/handle.h"
#include "dart/runtime/include/dart_api.h"
#include "flutter/assets/zip_asset_store.h"
#include "flutter/common/threads.h"
Expand All @@ -21,11 +21,11 @@
#include "flutter/runtime/dart_controller.h"
#include "flutter/runtime/dart_init.h"
#include "flutter/runtime/runtime_init.h"
#include "dart-pkg/zircon/sdk_ext/handle.h"
#include "lib/app/cpp/connect.h"
#include "lib/fsl/vmo/vector.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/fxl/logging.h"
#include "lib/fxl/time/time_delta.h"
#include "lib/fsl/vmo/vector.h"
#include "lib/zip/create_unzipper.h"
#include "third_party/rapidjson/rapidjson/document.h"
#include "third_party/rapidjson/rapidjson/stringbuffer.h"
Expand Down Expand Up @@ -371,8 +371,8 @@ void RuntimeHolder::InitDartIoInternal() {
Dart_Handle namespace_args[1];
namespace_args[0] = Dart_NewInteger(reinterpret_cast<intptr_t>(namespc_));
DART_CHECK_VALID(namespace_args[0]);
DART_CHECK_VALID(Dart_Invoke(
namespace_type, ToDart("_setupNamespace"), 1, namespace_args));
DART_CHECK_VALID(Dart_Invoke(namespace_type, ToDart("_setupNamespace"), 1,
namespace_args));

// Disable dart:io exit()
Dart_Handle embedder_config_type =
Expand All @@ -385,8 +385,8 @@ void RuntimeHolder::InitDartIoInternal() {
void RuntimeHolder::InitFuchsia() {
fidl::InterfaceHandle<app::ApplicationEnvironment> environment;
context_->ConnectToEnvironmentService(environment.NewRequest());
fuchsia::dart::Initialize(std::move(environment), std::move(outgoing_services_));

fuchsia::dart::Initialize(std::move(environment),
std::move(outgoing_services_));
}

void RuntimeHolder::InitMozartInternal() {
Expand Down
14 changes: 7 additions & 7 deletions content_handler/runtime_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@

#include <unordered_set>

#include "lib/app/cpp/application_context.h"
#include "lib/app/fidl/application_environment.fidl.h"
#include "lib/app/fidl/service_provider.fidl.h"
#include "lib/ui/flutter/sdk_ext/src/natives.h"
#include "lib/ui/input/fidl/input_connection.fidl.h"
#include "lib/ui/input/fidl/text_input.fidl.h"
#include "lib/ui/views/fidl/view_manager.fidl.h"
#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h"
#include "flutter/assets/unzipper_provider.h"
#include "flutter/assets/zip_asset_store.h"
#include "flutter/flow/layers/layer_tree.h"
#include "flutter/lib/ui/window/viewport_metrics.h"
#include "flutter/runtime/runtime_controller.h"
#include "flutter/runtime/runtime_delegate.h"
#include "lib/app/cpp/application_context.h"
#include "lib/app/fidl/application_environment.fidl.h"
#include "lib/app/fidl/service_provider.fidl.h"
#include "lib/fidl/cpp/bindings/binding.h"
#include "lib/fxl/functional/closure.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/memory/weak_ptr.h"
#include "lib/ui/flutter/sdk_ext/src/natives.h"
#include "lib/ui/input/fidl/input_connection.fidl.h"
#include "lib/ui/input/fidl/text_input.fidl.h"
#include "lib/ui/views/fidl/view_manager.fidl.h"

namespace flutter_runner {
class Rasterizer;
Expand Down
11 changes: 5 additions & 6 deletions content_handler/service_protocol_hooks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ void ServiceProtocolHooks::RegisterHooks(bool running_precompiled_code) {
nullptr);
}


const char* ServiceProtocolHooks::kListViewsExtensionName =
"_flutter.listViews";

bool ServiceProtocolHooks::ListViews(const char* method,
const char** param_keys,
const char** param_values,
intptr_t num_params,
void* user_data,
const char** json_object) {
const char** param_keys,
const char** param_values,
intptr_t num_params,
void* user_data,
const char** json_object) {
// Ask the App for the list of platform views. This will run a task on
// the UI thread before returning.
App& app = App::Shared();
Expand Down
4 changes: 2 additions & 2 deletions content_handler/session_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
#ifndef FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_
#define FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_

#include "lib/ui/scenic/client/resources.h"
#include "lib/ui/scenic/client/session.h"
#include "flutter/common/threads.h"
#include "flutter/content_handler/vulkan_surface_producer.h"
#include "flutter/flow/compositor_context.h"
#include "flutter/flow/scene_update_context.h"
#include "lib/fidl/cpp/bindings/interface_handle.h"
#include "lib/fxl/functional/closure.h"
#include "lib/fxl/macros.h"
#include "lib/ui/scenic/client/resources.h"
#include "lib/ui/scenic/client/session.h"
#include "magenta/system/ulib/mx/include/mx/eventpair.h"

namespace flutter_runner {
Expand Down
23 changes: 12 additions & 11 deletions content_handler/vulkan_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ GrBackendSemaphore VulkanSurface::GetAcquireSemaphore() const {
return gr_semaphore;
}

vulkan::VulkanHandle<VkSemaphore>
VulkanSurface::SemaphoreFromEvent(const mx::event &event) const {
vulkan::VulkanHandle<VkSemaphore> VulkanSurface::SemaphoreFromEvent(
const mx::event& event) const {
VkResult result;
VkSemaphore semaphore;

Expand Down Expand Up @@ -187,7 +187,7 @@ bool VulkanSurface::AllocateDeviceMemory(sk_sp<GrContext> context,
vk_.GetImageMemoryRequirements(backend_context_->fDevice, //
vk_image_, //
&memory_reqs //
);
);

uint32_t memory_type = 0;
for (; memory_type < 32; memory_type++) {
Expand Down Expand Up @@ -261,18 +261,19 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp<GrContext> context,
.fLevelCount = image_create_info.mipLevels,
};

GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0, 0, image_info);
GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0, 0,
image_info);

SkSurfaceProps sk_surface_props(
SkSurfaceProps::InitType::kLegacyFontHost_InitType);

auto sk_surface =
SkSurface::MakeFromBackendRenderTarget(context.get(), //
sk_render_target, //
kTopLeft_GrSurfaceOrigin, //
nullptr, //
&sk_surface_props //
);
SkSurface::MakeFromBackendRenderTarget(context.get(), //
sk_render_target, //
kTopLeft_GrSurfaceOrigin, //
nullptr, //
&sk_surface_props //
);

if (!sk_surface || sk_surface->getCanvas() == nullptr) {
return false;
Expand All @@ -289,7 +290,7 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session,
}

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

auto image_info = scenic::ImageInfo::New();
image_info->width = sk_surface_->width();
Expand Down
10 changes: 5 additions & 5 deletions content_handler/vulkan_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#pragma once

#include <memory>
#include "lib/ui/scenic/client/resources.h"
#include "flutter/flow/scene_update_context.h"
#include "flutter/vulkan/vulkan_handle.h"
#include "flutter/vulkan/vulkan_proc_table.h"
#include "lib/fxl/macros.h"
#include "lib/fsl/tasks/message_loop.h"
#include "lib/fsl/tasks/message_loop_handler.h"
#include "lib/fxl/macros.h"
#include "lib/ui/scenic/client/resources.h"
#include "mx/event.h"
#include "mx/vmo.h"
#include "third_party/skia/include/core/SkSurface.h"
Expand Down Expand Up @@ -55,7 +55,7 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface,
// VkSemaphore)
GrBackendSemaphore GetAcquireSemaphore() const;

private:
private:
vulkan::VulkanProcTable& vk_;
sk_sp<GrVkBackendContext> backend_context_;
scenic_lib::Session* session_;
Expand Down Expand Up @@ -92,8 +92,8 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface,

void Reset();

vulkan::VulkanHandle<VkSemaphore>
SemaphoreFromEvent(const mx::event &event) const;
vulkan::VulkanHandle<VkSemaphore> SemaphoreFromEvent(
const mx::event& event) const;

FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface);
};
Expand Down
2 changes: 1 addition & 1 deletion content_handler/vulkan_surface_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void VulkanSurfacePool::TraceStats() {
"SkiaCacheResources", skia_resources, //
"SkiaCacheBytes", skia_bytes, //
"SkiaCachePurgeable", skia_cache_purgeable //
);
);

// Reset per present/frame stats.
trace_surfaces_created_ = 0;
Expand Down
14 changes: 6 additions & 8 deletions content_handler/vulkan_surface_producer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
// found in the LICENSE file.

#include "flutter/content_handler/vulkan_surface_producer.h"
#include <memory>
#include <string>
#include <vector>
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/vk/GrVkTypes.h"
#include "third_party/skia/src/gpu/vk/GrVkUtil.h"
#include <memory>
#include <string>
#include <vector>

namespace flutter_runner {

Expand All @@ -33,8 +33,7 @@ VulkanSurfaceProducer::~VulkanSurfaceProducer() {
FXL_DCHECK(wait_result == VK_SUCCESS);
};

bool VulkanSurfaceProducer::Initialize(
scenic_lib::Session* mozart_session) {
bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) {
vk_ = fxl::MakeRefCounted<vulkan::VulkanProcTable>();

std::vector<std::string> extensions = {
Expand Down Expand Up @@ -119,11 +118,10 @@ void VulkanSurfaceProducer::OnSurfacesPresented(
std::vector<
std::unique_ptr<flow::SceneUpdateContext::SurfaceProducerSurface>>
surfaces) {

std::vector<GrBackendSemaphore> semaphores;
semaphores.reserve(surfaces.size());
for (auto &surface : surfaces) {
auto vk_surface = static_cast<VulkanSurface *>(surface.get());
for (auto& surface : surfaces) {
auto vk_surface = static_cast<VulkanSurface*>(surface.get());
semaphores.push_back(vk_surface->GetAcquireSemaphore());
}

Expand Down
6 changes: 3 additions & 3 deletions content_handler/vulkan_surface_producer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_
#define FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_

#include "lib/ui/scenic/client/resources.h"
#include "lib/ui/scenic/client/session.h"
#include "flutter/content_handler/vulkan_surface.h"
#include "flutter/content_handler/vulkan_surface_pool.h"
#include "flutter/flow/scene_update_context.h"
#include "flutter/vulkan/vulkan_application.h"
#include "flutter/vulkan/vulkan_device.h"
#include "flutter/vulkan/vulkan_proc_table.h"
#include "lib/fxl/macros.h"
#include "lib/fsl/tasks/message_loop.h"
#include "lib/fxl/macros.h"
#include "lib/ui/scenic/client/resources.h"
#include "lib/ui/scenic/client/session.h"
#include "third_party/skia/include/gpu/vk/GrVkBackendContext.h"

namespace flutter_runner {
Expand Down
Loading

0 comments on commit 08961f8

Please sign in to comment.