Format all c-like sources with clang-format (flutter/engine#4088)
* format * license script adaptions * updated licenses * review comments
This commit is contained in:
committed by
GitHub
parent
0d77e02338
commit
ac24af87f0
@@ -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 {
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
#include <mx/eventpair.h>
|
||||
|
||||
#include "lib/ui/scenic/client/resources.h"
|
||||
#include "flutter/flow/scene_update_context.h"
|
||||
#include "dart-pkg/zircon/sdk_ext/handle.h"
|
||||
#include "flutter/flow/scene_update_context.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/ref_counted.h"
|
||||
#include "lib/fxl/synchronization/mutex.h"
|
||||
#include "lib/fxl/synchronization/thread_annotations.h"
|
||||
#include "lib/ui/scenic/client/resources.h"
|
||||
#include "third_party/skia/include/core/SkPoint.h"
|
||||
|
||||
namespace flow {
|
||||
|
||||
@@ -87,8 +87,7 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const {
|
||||
const double sample_margin_unit_width = sample_unit_width / 6.0;
|
||||
const double sample_margin_width = width * sample_margin_unit_width;
|
||||
path.moveTo(x, bottom);
|
||||
path.lineTo(x, y +
|
||||
height * (1.0 - UnitHeight(laps_[0].ToMillisecondsF(),
|
||||
path.lineTo(x, y + height * (1.0 - UnitHeight(laps_[0].ToMillisecondsF(),
|
||||
max_unit_interval)));
|
||||
double unit_x;
|
||||
double unit_next_x = 0.0;
|
||||
@@ -96,16 +95,14 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const {
|
||||
unit_x = unit_next_x;
|
||||
unit_next_x = (static_cast<double>(i + 1) / kMaxSamples);
|
||||
const double sample_y =
|
||||
y +
|
||||
height *
|
||||
(1.0 - UnitHeight(laps_[i].ToMillisecondsF(), max_unit_interval));
|
||||
y + height * (1.0 - UnitHeight(laps_[i].ToMillisecondsF(),
|
||||
max_unit_interval));
|
||||
path.lineTo(x + width * unit_x + sample_margin_width, sample_y);
|
||||
path.lineTo(x + width * unit_next_x - sample_margin_width, sample_y);
|
||||
}
|
||||
path.lineTo(
|
||||
right,
|
||||
y +
|
||||
height * (1.0 - UnitHeight(laps_[kMaxSamples - 1].ToMillisecondsF(),
|
||||
y + height * (1.0 - UnitHeight(laps_[kMaxSamples - 1].ToMillisecondsF(),
|
||||
max_unit_interval)));
|
||||
path.lineTo(right, bottom);
|
||||
path.close();
|
||||
|
||||
@@ -34,9 +34,9 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
// Treating the shape as a rectangle for now.
|
||||
auto bounds = clip_path_.getBounds();
|
||||
scenic_lib::Rectangle shape(context.session(), // session
|
||||
bounds.width(), // width
|
||||
bounds.height() // height
|
||||
);
|
||||
bounds.width(), // width
|
||||
bounds.height() // height
|
||||
);
|
||||
|
||||
SceneUpdateContext::Clip clip(context, shape, bounds);
|
||||
UpdateSceneChildren(context);
|
||||
|
||||
@@ -25,9 +25,9 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
scenic_lib::Rectangle shape(context.session(), // session
|
||||
clip_rect_.width(), // width
|
||||
clip_rect_.height() // height
|
||||
);
|
||||
clip_rect_.width(), // width
|
||||
clip_rect_.height() // height
|
||||
);
|
||||
|
||||
SceneUpdateContext::Clip clip(context, shape, clip_rect_);
|
||||
UpdateSceneChildren(context);
|
||||
|
||||
@@ -34,7 +34,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
clip_rrect_.radii(SkRRect::kLowerRight_Corner)
|
||||
.x(), // bottom_right_radius
|
||||
clip_rrect_.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius
|
||||
);
|
||||
);
|
||||
|
||||
SceneUpdateContext::Clip clip(context, shape, clip_rrect_.getBounds());
|
||||
UpdateSceneChildren(context);
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
|
||||
#if defined(OS_FUCHSIA)
|
||||
|
||||
#include "lib/ui/scenic/client/resources.h" //nogncheck
|
||||
#include "lib/ui/scenic/client/session.h" //nogncheck
|
||||
#include "flutter/flow/scene_update_context.h" //nogncheck
|
||||
#include "flutter/flow/scene_update_context.h" //nogncheck
|
||||
#include "lib/ui/scenic/client/resources.h" //nogncheck
|
||||
#include "lib/ui/scenic/client/session.h" //nogncheck
|
||||
|
||||
#endif // defined(OS_FUCHSIA)
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame,
|
||||
checkerboard_raster_cache_images_);
|
||||
Layer::PrerollContext context = {
|
||||
ignore_raster_cache ? nullptr : &frame.context().raster_cache(),
|
||||
frame.gr_context(), color_space, SkRect::MakeEmpty(),
|
||||
frame.gr_context(),
|
||||
color_space,
|
||||
SkRect::MakeEmpty(),
|
||||
};
|
||||
|
||||
root_layer_->Preroll(&context, SkMatrix::I());
|
||||
|
||||
@@ -46,7 +46,7 @@ void PictureLayer::Paint(PaintContext& context) {
|
||||
raster_cache_result_.destination_rect(), // destination
|
||||
nullptr, // paint
|
||||
SkCanvas::kStrict_SrcRectConstraint // source constraint
|
||||
);
|
||||
);
|
||||
} else {
|
||||
context.canvas.drawPicture(picture_.get());
|
||||
}
|
||||
|
||||
@@ -12,9 +12,7 @@ namespace flow {
|
||||
|
||||
namespace {
|
||||
|
||||
sk_sp<SkShader> CreateCheckerboardShader(SkColor c1,
|
||||
SkColor c2,
|
||||
int size) {
|
||||
sk_sp<SkShader> CreateCheckerboardShader(SkColor c1, SkColor c2, int size) {
|
||||
SkBitmap bm;
|
||||
bm.allocN32Pixels(2 * size, 2 * size);
|
||||
bm.eraseColor(c1);
|
||||
@@ -26,10 +24,7 @@ sk_sp<SkShader> CreateCheckerboardShader(SkColor c1,
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
void DrawCheckerboard(SkCanvas* canvas,
|
||||
SkColor c1,
|
||||
SkColor c2,
|
||||
int size) {
|
||||
void DrawCheckerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) {
|
||||
SkPaint paint;
|
||||
paint.setShader(CreateCheckerboardShader(c1, c2, size));
|
||||
canvas->drawPaint(paint);
|
||||
|
||||
@@ -82,11 +82,11 @@ RasterCacheResult RasterizePicture(SkPicture* picture,
|
||||
SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()),
|
||||
std::fabs(logical_rect.height() * scale.y()));
|
||||
|
||||
const SkImageInfo image_info =
|
||||
SkImageInfo::MakeN32Premul(std::ceil(physical_rect.width()), // physical width
|
||||
std::ceil(physical_rect.height()), // physical height
|
||||
sk_ref_sp(dst_color_space) // colorspace
|
||||
);
|
||||
const SkImageInfo image_info = SkImageInfo::MakeN32Premul(
|
||||
std::ceil(physical_rect.width()), // physical width
|
||||
std::ceil(physical_rect.height()), // physical height
|
||||
sk_ref_sp(dst_color_space) // colorspace
|
||||
);
|
||||
|
||||
sk_sp<SkSurface> surface =
|
||||
context
|
||||
|
||||
@@ -33,14 +33,14 @@ TEST(RasterCache, ThresholdIsRespected) {
|
||||
sk_sp<SkImage> image;
|
||||
|
||||
sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 1
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 1
|
||||
cache.SweepAfterFrame();
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 2
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 2
|
||||
cache.SweepAfterFrame();
|
||||
ASSERT_TRUE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 3
|
||||
ASSERT_TRUE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 3
|
||||
cache.SweepAfterFrame();
|
||||
}
|
||||
|
||||
@@ -55,14 +55,14 @@ TEST(RasterCache, ThresholdIsRespectedWhenZero) {
|
||||
sk_sp<SkImage> image;
|
||||
|
||||
sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 1
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 1
|
||||
cache.SweepAfterFrame();
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 2
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 2
|
||||
cache.SweepAfterFrame();
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 3
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 3
|
||||
cache.SweepAfterFrame();
|
||||
}
|
||||
|
||||
@@ -77,19 +77,19 @@ TEST(RasterCache, SweepsRemoveUnusedFrames) {
|
||||
sk_sp<SkImage> image;
|
||||
|
||||
sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 1
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 1
|
||||
cache.SweepAfterFrame();
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 2
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 2
|
||||
cache.SweepAfterFrame();
|
||||
ASSERT_TRUE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 3
|
||||
ASSERT_TRUE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 3
|
||||
cache.SweepAfterFrame();
|
||||
ASSERT_TRUE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 4
|
||||
ASSERT_TRUE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 4
|
||||
cache.SweepAfterFrame();
|
||||
cache.SweepAfterFrame(); // Extra frame without a preroll image access.
|
||||
ASSERT_FALSE(
|
||||
cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 5
|
||||
ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(),
|
||||
true, false)); // 5
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node,
|
||||
rrect.radii(SkRRect::kUpperRight_Corner).x(), // top_right_radius
|
||||
rrect.radii(SkRRect::kLowerRight_Corner).x(), // bottom_right_radius
|
||||
rrect.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius
|
||||
);
|
||||
);
|
||||
scenic_lib::ShapeNode shape_node(session_);
|
||||
shape_node.SetShape(shape);
|
||||
shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(),
|
||||
@@ -102,7 +102,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node,
|
||||
SetShapeColor(shape_node, color);
|
||||
|
||||
scenic_lib::Rectangle inner_shape(session_, inner_bounds.width(),
|
||||
inner_bounds.height());
|
||||
inner_bounds.height());
|
||||
scenic_lib::ShapeNode inner_node(session_);
|
||||
inner_node.SetShape(inner_shape);
|
||||
inner_node.SetTranslation(inner_bounds.width() * 0.5f + inner_bounds.left(),
|
||||
@@ -255,12 +255,12 @@ SceneUpdateContext::Transform::Transform(SceneUpdateContext& context,
|
||||
entity_node().SetTranslation(decomposition.translation().x(), //
|
||||
decomposition.translation().y(), //
|
||||
decomposition.translation().z() //
|
||||
);
|
||||
);
|
||||
|
||||
entity_node().SetScale(decomposition.scale().x(), //
|
||||
decomposition.scale().y(), //
|
||||
decomposition.scale().z() //
|
||||
);
|
||||
);
|
||||
context.top_scale_x_ *= decomposition.scale().x();
|
||||
context.top_scale_y_ *= decomposition.scale().y();
|
||||
|
||||
@@ -268,7 +268,7 @@ SceneUpdateContext::Transform::Transform(SceneUpdateContext& context,
|
||||
decomposition.rotation().fData[1], //
|
||||
decomposition.rotation().fData[2], //
|
||||
decomposition.rotation().fData[3] //
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "lib/ui/scenic/client/resources.h"
|
||||
#include "flutter/flow/compositor_context.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/ui/scenic/client/resources.h"
|
||||
#include "third_party/skia/include/core/SkRect.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
|
||||
@@ -167,12 +167,11 @@ class SceneUpdateContext {
|
||||
const SkRect& paint_bounds,
|
||||
std::vector<Layer*> paint_layers);
|
||||
void SetShapeColor(scenic_lib::ShapeNode& shape_node, SkColor color);
|
||||
scenic_lib::Image* GenerateImageIfNeeded(
|
||||
SkColor color,
|
||||
SkScalar scale_x,
|
||||
SkScalar scale_y,
|
||||
const SkRect& paint_bounds,
|
||||
std::vector<Layer*> paint_layers);
|
||||
scenic_lib::Image* GenerateImageIfNeeded(SkColor color,
|
||||
SkScalar scale_x,
|
||||
SkScalar scale_y,
|
||||
const SkRect& paint_bounds,
|
||||
std::vector<Layer*> paint_layers);
|
||||
|
||||
Entity* top_entity_ = nullptr;
|
||||
float top_scale_x_ = 1.f;
|
||||
|
||||
@@ -51,7 +51,7 @@ MessageLoopAndroid::MessageLoopAndroid()
|
||||
kWakeEvents, // events
|
||||
read_event_fd, // callback
|
||||
this // baton
|
||||
);
|
||||
);
|
||||
FXL_CHECK(add_result == 1);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ void MessageLoopAndroid::Run() {
|
||||
nullptr, // out fd,
|
||||
nullptr, // out events,
|
||||
nullptr // out data
|
||||
);
|
||||
);
|
||||
if (result == ALOOPER_POLL_TIMEOUT || result == ALOOPER_POLL_ERROR) {
|
||||
// This handles the case where the loop is terminated using ALooper APIs.
|
||||
running_ = false;
|
||||
|
||||
@@ -18,7 +18,8 @@ std::pair<bool, std::string> GetExecutableDirectoryPath() {
|
||||
if (read_size == -1) {
|
||||
return {false, ""};
|
||||
}
|
||||
return {true, files::GetDirectoryName(std::string{path, static_cast<size_t>(read_size)})};
|
||||
return {true, files::GetDirectoryName(
|
||||
std::string{path, static_cast<size_t>(read_size)})};
|
||||
}
|
||||
|
||||
} // namespace paths
|
||||
|
||||
@@ -57,10 +57,10 @@ void Thread::Join() {
|
||||
// a MSDN article: http://msdn2.microsoft.com/en-us/library/xcb2z8hs.aspx
|
||||
const DWORD kVCThreadNameException = 0x406D1388;
|
||||
typedef struct tagTHREADNAME_INFO {
|
||||
DWORD dwType; // Must be 0x1000.
|
||||
LPCSTR szName; // Pointer to name (in user addr space).
|
||||
DWORD dwType; // Must be 0x1000.
|
||||
LPCSTR szName; // Pointer to name (in user addr space).
|
||||
DWORD dwThreadID; // Thread ID (-1=caller thread).
|
||||
DWORD dwFlags; // Reserved for future use, must be zero.
|
||||
DWORD dwFlags; // Reserved for future use, must be zero.
|
||||
} THREADNAME_INFO;
|
||||
#endif
|
||||
|
||||
@@ -79,9 +79,9 @@ void Thread::SetCurrentThreadName(const std::string& name) {
|
||||
info.dwThreadID = GetCurrentThreadId();
|
||||
info.dwFlags = 0;
|
||||
__try {
|
||||
RaiseException(kVCThreadNameException, 0, sizeof(info)/sizeof(DWORD),
|
||||
RaiseException(kVCThreadNameException, 0, sizeof(info) / sizeof(DWORD),
|
||||
reinterpret_cast<DWORD_PTR*>(&info));
|
||||
} __except(EXCEPTION_CONTINUE_EXECUTION) {
|
||||
} __except (EXCEPTION_CONTINUE_EXECUTION) {
|
||||
}
|
||||
#else
|
||||
#error Unsupported Platform
|
||||
|
||||
@@ -17,7 +17,7 @@ void TraceEvent0(TraceArg category_group, TraceArg name) {
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEvent1(TraceArg category_group,
|
||||
@@ -33,7 +33,7 @@ void TraceEvent1(TraceArg category_group,
|
||||
1, // argument_count
|
||||
arg_names, // argument_names
|
||||
arg_values // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEvent2(TraceArg category_group,
|
||||
@@ -51,7 +51,7 @@ void TraceEvent2(TraceArg category_group,
|
||||
2, // argument_count
|
||||
arg_names, // argument_names
|
||||
arg_values // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventEnd(TraceArg name) {
|
||||
@@ -62,7 +62,7 @@ void TraceEventEnd(TraceArg name) {
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventAsyncBegin0(TraceArg category_group,
|
||||
@@ -75,7 +75,7 @@ void TraceEventAsyncBegin0(TraceArg category_group,
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventAsyncEnd0(TraceArg category_group,
|
||||
@@ -88,7 +88,7 @@ void TraceEventAsyncEnd0(TraceArg category_group,
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventAsyncBegin1(TraceArg category_group,
|
||||
@@ -105,7 +105,7 @@ void TraceEventAsyncBegin1(TraceArg category_group,
|
||||
1, // argument_count
|
||||
arg_names, // argument_names
|
||||
arg_values // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventAsyncEnd1(TraceArg category_group,
|
||||
@@ -122,7 +122,7 @@ void TraceEventAsyncEnd1(TraceArg category_group,
|
||||
1, // argument_count
|
||||
arg_names, // argument_names
|
||||
arg_values // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventInstant0(TraceArg category_group, TraceArg name) {
|
||||
@@ -133,7 +133,7 @@ void TraceEventInstant0(TraceArg category_group, TraceArg name) {
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventFlowBegin0(TraceArg category_group,
|
||||
@@ -146,7 +146,7 @@ void TraceEventFlowBegin0(TraceArg category_group,
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventFlowStep0(TraceArg category_group,
|
||||
@@ -159,7 +159,7 @@ void TraceEventFlowStep0(TraceArg category_group,
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id) {
|
||||
@@ -170,7 +170,7 @@ void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id) {
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
} // namespace tracing
|
||||
|
||||
@@ -23,10 +23,9 @@ fxl::RefPtr<Scene> Scene::create(std::unique_ptr<flow::Layer> rootLayer,
|
||||
uint32_t rasterizerTracingThreshold,
|
||||
bool checkerboardRasterCacheImages,
|
||||
bool checkerboardOffscreenLayers) {
|
||||
return fxl::MakeRefCounted<Scene>(std::move(rootLayer),
|
||||
rasterizerTracingThreshold,
|
||||
checkerboardRasterCacheImages,
|
||||
checkerboardOffscreenLayers);
|
||||
return fxl::MakeRefCounted<Scene>(
|
||||
std::move(rootLayer), rasterizerTracingThreshold,
|
||||
checkerboardRasterCacheImages, checkerboardOffscreenLayers);
|
||||
}
|
||||
|
||||
Scene::Scene(std::unique_ptr<flow::Layer> rootLayer,
|
||||
@@ -38,8 +37,7 @@ Scene::Scene(std::unique_ptr<flow::Layer> rootLayer,
|
||||
m_layerTree->set_rasterizer_tracing_threshold(rasterizerTracingThreshold);
|
||||
m_layerTree->set_checkerboard_raster_cache_images(
|
||||
checkerboardRasterCacheImages);
|
||||
m_layerTree->set_checkerboard_offscreen_layers(
|
||||
checkerboardOffscreenLayers);
|
||||
m_layerTree->set_checkerboard_offscreen_layers(checkerboardOffscreenLayers);
|
||||
}
|
||||
|
||||
Scene::~Scene() {}
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
#include "flutter/flow/layers/picture_layer.h"
|
||||
#include "flutter/flow/layers/shader_mask_layer.h"
|
||||
#include "flutter/flow/layers/transform_layer.h"
|
||||
#include "flutter/lib/ui/ui_dart_state.h"
|
||||
#include "flutter/lib/ui/painting/matrix.h"
|
||||
#include "flutter/lib/ui/painting/shader.h"
|
||||
#include "flutter/lib/ui/ui_dart_state.h"
|
||||
#include "flutter/lib/ui/window/window.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
@@ -165,7 +165,8 @@ void SceneBuilder::pushPhysicalModel(const RRect& rrect,
|
||||
if (!cullRect.intersect(rrect.sk_rrect.rect(), m_cullRects.top()))
|
||||
cullRect = SkRect::MakeEmpty();
|
||||
|
||||
SkScalar dpr = UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio;
|
||||
SkScalar dpr =
|
||||
UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio;
|
||||
|
||||
std::unique_ptr<flow::PhysicalModelLayer> layer(
|
||||
new flow::PhysicalModelLayer());
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
#include <android/log.h>
|
||||
#elif defined(OS_IOS)
|
||||
extern "C" {
|
||||
// Cannot import the syslog.h header directly because of macro collision.
|
||||
extern void syslog(int, const char*, ...);
|
||||
// Cannot import the syslog.h header directly because of macro collision.
|
||||
extern void syslog(int, const char*, ...);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#define FLUTTER_LIB_UI_DART_RUNTIME_HOOKS_H_
|
||||
|
||||
#include "dart/runtime/include/dart_api.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "flutter/flow/layers/physical_model_layer.h"
|
||||
#include "flutter/lib/ui/ui_dart_state.h"
|
||||
#include "flutter/lib/ui/painting/image.h"
|
||||
#include "flutter/lib/ui/painting/matrix.h"
|
||||
#include "flutter/lib/ui/ui_dart_state.h"
|
||||
#include "flutter/lib/ui/window/window.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
@@ -75,8 +75,9 @@ fxl::RefPtr<Canvas> Canvas::Create(PictureRecorder* recorder,
|
||||
double right,
|
||||
double bottom) {
|
||||
if (!recorder)
|
||||
Dart_ThrowException(ToDart("Canvas constructor called with non-genuine PictureRecorder."));
|
||||
FXL_DCHECK(!recorder->isRecording()); // verified by Dart code
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas constructor called with non-genuine PictureRecorder."));
|
||||
FXL_DCHECK(!recorder->isRecording()); // verified by Dart code
|
||||
fxl::RefPtr<Canvas> canvas = fxl::MakeRefCounted<Canvas>(
|
||||
recorder->BeginRecording(SkRect::MakeLTRB(left, top, right, bottom)));
|
||||
recorder->set_canvas(canvas);
|
||||
@@ -157,7 +158,8 @@ void Canvas::transform(const tonic::Float64List& matrix4) {
|
||||
void Canvas::clipRect(double left, double top, double right, double bottom) {
|
||||
if (!canvas_)
|
||||
return;
|
||||
canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), SkClipOp::kIntersect, true);
|
||||
canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom),
|
||||
SkClipOp::kIntersect, true);
|
||||
}
|
||||
|
||||
void Canvas::clipRRect(const RRect& rrect) {
|
||||
@@ -170,7 +172,8 @@ void Canvas::clipPath(const CanvasPath* path) {
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!path)
|
||||
Dart_ThrowException(ToDart("Canvas.clipPath called with non-genuine Path."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.clipPath called with non-genuine Path."));
|
||||
canvas_->clipPath(path->path(), true);
|
||||
}
|
||||
|
||||
@@ -268,7 +271,8 @@ void Canvas::drawPath(const CanvasPath* path,
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!path)
|
||||
Dart_ThrowException(ToDart("Canvas.drawPath called with non-genuine Path."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawPath called with non-genuine Path."));
|
||||
canvas_->drawPath(path->path(), *paint.paint());
|
||||
}
|
||||
|
||||
@@ -280,7 +284,8 @@ void Canvas::drawImage(const CanvasImage* image,
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!image)
|
||||
Dart_ThrowException(ToDart("Canvas.drawImage called with non-genuine Image."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawImage called with non-genuine Image."));
|
||||
canvas_->drawImage(image->image(), x, y, paint.paint());
|
||||
}
|
||||
|
||||
@@ -298,7 +303,8 @@ void Canvas::drawImageRect(const CanvasImage* image,
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!image)
|
||||
Dart_ThrowException(ToDart("Canvas.drawImageRect called with non-genuine Image."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawImageRect called with non-genuine Image."));
|
||||
SkRect src = SkRect::MakeLTRB(src_left, src_top, src_right, src_bottom);
|
||||
SkRect dst = SkRect::MakeLTRB(dst_left, dst_top, dst_right, dst_bottom);
|
||||
canvas_->drawImageRect(image->image(), src, dst, paint.paint(),
|
||||
@@ -319,7 +325,8 @@ void Canvas::drawImageNine(const CanvasImage* image,
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!image)
|
||||
Dart_ThrowException(ToDart("Canvas.drawImageNine called with non-genuine Image."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawImageNine called with non-genuine Image."));
|
||||
SkRect center =
|
||||
SkRect::MakeLTRB(center_left, center_top, center_right, center_bottom);
|
||||
SkIRect icenter;
|
||||
@@ -332,7 +339,8 @@ void Canvas::drawPicture(Picture* picture) {
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!picture)
|
||||
Dart_ThrowException(ToDart("Canvas.drawPicture called with non-genuine Picture."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawPicture called with non-genuine Picture."));
|
||||
canvas_->drawPicture(picture->picture().get());
|
||||
}
|
||||
|
||||
@@ -359,11 +367,10 @@ void Canvas::drawVertices(const Vertices* vertices,
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!vertices)
|
||||
Dart_ThrowException(ToDart("Canvas.drawVertices called with non-genuine Vertices."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawVertices called with non-genuine Vertices."));
|
||||
|
||||
canvas_->drawVertices(vertices->vertices(),
|
||||
blend_mode,
|
||||
*paint.paint());
|
||||
canvas_->drawVertices(vertices->vertices(), blend_mode, *paint.paint());
|
||||
}
|
||||
|
||||
void Canvas::drawAtlas(const Paint& paint,
|
||||
@@ -377,7 +384,9 @@ void Canvas::drawAtlas(const Paint& paint,
|
||||
if (!canvas_)
|
||||
return;
|
||||
if (!atlas)
|
||||
Dart_ThrowException(ToDart("Canvas.drawAtlas or Canvas.drawRawAtlas called with non-genuine Image."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawAtlas or Canvas.drawRawAtlas called with "
|
||||
"non-genuine Image."));
|
||||
|
||||
sk_sp<SkImage> skImage = atlas->image();
|
||||
|
||||
@@ -400,14 +409,12 @@ void Canvas::drawShadow(const CanvasPath* path,
|
||||
double elevation,
|
||||
bool transparentOccluder) {
|
||||
if (!path)
|
||||
Dart_ThrowException(ToDart("Canvas.drawShader called with non-genuine Path."));
|
||||
SkScalar dpr = UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio;
|
||||
flow::PhysicalModelLayer::DrawShadow(canvas_,
|
||||
path->path(),
|
||||
color,
|
||||
elevation,
|
||||
transparentOccluder,
|
||||
dpr);
|
||||
Dart_ThrowException(
|
||||
ToDart("Canvas.drawShader called with non-genuine Path."));
|
||||
SkScalar dpr =
|
||||
UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio;
|
||||
flow::PhysicalModelLayer::DrawShadow(canvas_, path->path(), color, elevation,
|
||||
transparentOccluder, dpr);
|
||||
}
|
||||
|
||||
void Canvas::Clear() {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
#include "flutter/lib/ui/painting/gradient.h"
|
||||
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace tonic {
|
||||
class DartLibraryNatives;
|
||||
} // namspace tonic
|
||||
} // namespace tonic
|
||||
|
||||
namespace blink {
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "flutter/common/threads.h"
|
||||
#include "flutter/lib/ui/painting/utils.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
#include "flutter/lib/ui/painting/image_filter.h"
|
||||
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
#include "third_party/skia/include/effects/SkBlurImageFilter.h"
|
||||
#include "third_party/skia/include/effects/SkImageSource.h"
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
#include "flutter/lib/ui/painting/image_shader.h"
|
||||
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
|
||||
using tonic::ToDart;
|
||||
@@ -38,7 +38,8 @@ void ImageShader::initWithImage(CanvasImage* image,
|
||||
SkShader::TileMode tmy,
|
||||
const tonic::Float64List& matrix4) {
|
||||
if (!image)
|
||||
Dart_ThrowException(ToDart("ImageShader constructor called with non-genuine Image."));
|
||||
Dart_ThrowException(
|
||||
ToDart("ImageShader constructor called with non-genuine Image."));
|
||||
SkMatrix sk_matrix = ToSkMatrix(matrix4);
|
||||
set_shader(image->image()->makeShader(tmx, tmy, &sk_matrix));
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "flutter/common/threads.h"
|
||||
#include "flutter/lib/ui/painting/utils.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
#include "third_party/skia/include/effects/SkBlurMaskFilter.h"
|
||||
|
||||
|
||||
@@ -97,8 +97,7 @@ Paint DartConverter<Paint>::FromArguments(Dart_NativeArguments args,
|
||||
|
||||
uint32_t encoded_blend_mode = uint_data[kBlendModeIndex];
|
||||
if (encoded_blend_mode) {
|
||||
uint32_t blend_mode =
|
||||
encoded_blend_mode ^ kBlendModeDefault;
|
||||
uint32_t blend_mode = encoded_blend_mode ^ kBlendModeDefault;
|
||||
paint.setBlendMode(static_cast<SkBlendMode>(blend_mode));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "flutter/lib/ui/painting/matrix.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
|
||||
using tonic::ToDart;
|
||||
@@ -174,7 +174,8 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) {
|
||||
|
||||
void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) {
|
||||
if (!path)
|
||||
Dart_ThrowException(ToDart("Path.extendWithPath called with non-genuine Path."));
|
||||
Dart_ThrowException(
|
||||
ToDart("Path.extendWithPath called with non-genuine Path."));
|
||||
path_.addPath(path->path(), dx, dy, SkPath::kExtend_AddPathMode);
|
||||
}
|
||||
|
||||
@@ -196,8 +197,7 @@ fxl::RefPtr<CanvasPath> CanvasPath::shift(double dx, double dy) {
|
||||
return path;
|
||||
}
|
||||
|
||||
fxl::RefPtr<CanvasPath> CanvasPath::transform(
|
||||
tonic::Float64List& matrix4) {
|
||||
fxl::RefPtr<CanvasPath> CanvasPath::transform(tonic::Float64List& matrix4) {
|
||||
fxl::RefPtr<CanvasPath> path = CanvasPath::Create();
|
||||
path_.transform(ToSkMatrix(matrix4), &path->path_);
|
||||
matrix4.Release();
|
||||
|
||||
@@ -38,9 +38,9 @@ Picture::~Picture() {
|
||||
fxl::RefPtr<CanvasImage> Picture::toImage(int width, int height) {
|
||||
fxl::RefPtr<CanvasImage> image = CanvasImage::Create();
|
||||
// TODO(abarth): We should pass in an SkColorSpace at some point.
|
||||
image->set_image(
|
||||
SkImage::MakeFromPicture(picture_, SkISize::Make(width, height), nullptr,
|
||||
nullptr, SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()));
|
||||
image->set_image(SkImage::MakeFromPicture(
|
||||
picture_, SkISize::Make(width, height), nullptr, nullptr,
|
||||
SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()));
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "flutter/lib/ui/painting/canvas.h"
|
||||
#include "flutter/lib/ui/painting/picture.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include "flutter/lib/ui/painting/rrect.h"
|
||||
|
||||
#include "lib/tonic/logging/dart_error.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "lib/tonic/logging/dart_error.h"
|
||||
#include "lib/tonic/typed_data/float32_list.h"
|
||||
|
||||
using namespace blink;
|
||||
|
||||
@@ -11,8 +11,7 @@ namespace blink {
|
||||
|
||||
IMPLEMENT_WRAPPERTYPEINFO(ui, Shader);
|
||||
|
||||
Shader::Shader(sk_sp<SkShader> shader) : shader_(shader) {
|
||||
}
|
||||
Shader::Shader(sk_sp<SkShader> shader) : shader_(shader) {}
|
||||
|
||||
Shader::~Shader() {
|
||||
// Skia objects must be deleted on the IO thread so that any associated GL
|
||||
@@ -20,4 +19,4 @@ Shader::~Shader() {
|
||||
SkiaUnrefOnIOThread(&shader_);
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
} // namespace blink
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "flutter/common/threads.h"
|
||||
#include "flutter/lib/ui/painting/utils.h"
|
||||
#include "flutter/common/threads.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -13,8 +13,7 @@ constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250);
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
SkiaUnrefQueue::SkiaUnrefQueue()
|
||||
: drain_pending_(false) {}
|
||||
SkiaUnrefQueue::SkiaUnrefQueue() : drain_pending_(false) {}
|
||||
|
||||
SkiaUnrefQueue SkiaUnrefQueue::instance_;
|
||||
|
||||
@@ -27,8 +26,7 @@ void SkiaUnrefQueue::Unref(SkRefCnt* object) {
|
||||
objects_.push_back(object);
|
||||
if (!drain_pending_) {
|
||||
drain_pending_ = true;
|
||||
Threads::IO()->PostDelayedTask([this] { Drain(); },
|
||||
kDrainDelay);
|
||||
Threads::IO()->PostDelayedTask([this] { Drain(); }, kDrainDelay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,11 +27,12 @@ class SkiaUnrefQueue {
|
||||
bool drain_pending_ FXL_GUARDED_BY(mutex_);
|
||||
};
|
||||
|
||||
template <typename T> void SkiaUnrefOnIOThread(sk_sp<T>* sp) {
|
||||
template <typename T>
|
||||
void SkiaUnrefOnIOThread(sk_sp<T>* sp) {
|
||||
T* object = sp->release();
|
||||
if (object) {
|
||||
SkiaUnrefQueue::Get().Unref(object);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
} // namespace blink
|
||||
|
||||
@@ -11,14 +11,13 @@ namespace blink {
|
||||
|
||||
namespace {
|
||||
|
||||
void DecodePoints(const tonic::Float32List& coords,
|
||||
SkPoint* points) {
|
||||
void DecodePoints(const tonic::Float32List& coords, SkPoint* points) {
|
||||
for (int i = 0; i < coords.num_elements(); i += 2)
|
||||
points[i / 2] = SkPoint::Make(coords[i], coords[i + 1]);
|
||||
}
|
||||
|
||||
template <typename T> void DecodeInts(const tonic::Int32List& ints,
|
||||
T* out) {
|
||||
template <typename T>
|
||||
void DecodeInts(const tonic::Int32List& ints, T* out) {
|
||||
for (int i = 0; i < ints.num_elements(); i++)
|
||||
out[i] = ints[i];
|
||||
}
|
||||
@@ -31,8 +30,7 @@ static void Vertices_constructor(Dart_NativeArguments args) {
|
||||
|
||||
IMPLEMENT_WRAPPERTYPEINFO(ui, Vertices);
|
||||
|
||||
#define FOR_EACH_BINDING(V) \
|
||||
V(Vertices, init)
|
||||
#define FOR_EACH_BINDING(V) V(Vertices, init)
|
||||
|
||||
FOR_EACH_BINDING(DART_NATIVE_CALLBACK)
|
||||
|
||||
@@ -60,10 +58,8 @@ void Vertices::init(SkVertices::VertexMode vertex_mode,
|
||||
if (colors.data())
|
||||
builderFlags |= SkVertices::kHasColors_BuilderFlag;
|
||||
|
||||
SkVertices::Builder builder(vertex_mode,
|
||||
positions.num_elements() / 2,
|
||||
indices.num_elements(),
|
||||
builderFlags);
|
||||
SkVertices::Builder builder(vertex_mode, positions.num_elements() / 2,
|
||||
indices.num_elements(), builderFlags);
|
||||
if (positions.data())
|
||||
DecodePoints(positions, builder.positions());
|
||||
if (texture_coordinates.data())
|
||||
|
||||
@@ -28,12 +28,11 @@ class Vertices : public fxl::RefCountedThreadSafe<Vertices>,
|
||||
|
||||
static fxl::RefPtr<Vertices> Create();
|
||||
|
||||
void init(
|
||||
SkVertices::VertexMode vertex_mode,
|
||||
const tonic::Float32List& positions,
|
||||
const tonic::Float32List& texture_coordinates,
|
||||
const tonic::Int32List& colors,
|
||||
const tonic::Int32List& indices);
|
||||
void init(SkVertices::VertexMode vertex_mode,
|
||||
const tonic::Float32List& positions,
|
||||
const tonic::Float32List& texture_coordinates,
|
||||
const tonic::Int32List& colors,
|
||||
const tonic::Int32List& indices);
|
||||
|
||||
const sk_sp<SkVertices>& vertices() const { return vertices_; }
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <mutex>
|
||||
#include "flutter/lib/ui/text/font_collection.h"
|
||||
#include <mutex>
|
||||
#include "third_party/rapidjson/rapidjson/document.h"
|
||||
#include "third_party/rapidjson/rapidjson/rapidjson.h"
|
||||
#include "third_party/skia/include/core/SkStream.h"
|
||||
|
||||
@@ -111,7 +111,7 @@ PassRefPtr<RenderStyle> decodeParagraphStyle(RenderStyle* parentStyle,
|
||||
double fontSize,
|
||||
double lineHeight,
|
||||
const std::u16string& ellipsis) {
|
||||
FXL_DCHECK(encoded.num_elements() == 6); // also update text.dart
|
||||
FXL_DCHECK(encoded.num_elements() == 6); // also update text.dart
|
||||
|
||||
RefPtr<RenderStyle> style = RenderStyle::create();
|
||||
style->inheritFrom(parentStyle);
|
||||
@@ -123,7 +123,8 @@ PassRefPtr<RenderStyle> decodeParagraphStyle(RenderStyle* parentStyle,
|
||||
style->setTextAlign(static_cast<ETextAlign>(encoded[psTextAlignIndex]));
|
||||
|
||||
if (mask & psTextDirectionMask)
|
||||
style->setDirection(static_cast<TextDirection>(encoded[psTextDirectionIndex]));
|
||||
style->setDirection(
|
||||
static_cast<TextDirection>(encoded[psTextDirectionIndex]));
|
||||
|
||||
if (mask & (psFontWeightMask | psFontStyleMask | psFontFamilyMask |
|
||||
psFontSizeMask)) {
|
||||
|
||||
@@ -49,7 +49,6 @@ void UIDartState::set_font_selector(PassRefPtr<FontSelector> selector) {
|
||||
font_selector_ = selector;
|
||||
}
|
||||
|
||||
|
||||
PassRefPtr<FontSelector> UIDartState::font_selector() {
|
||||
return font_selector_;
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ void PlatformMessageResponseDart::Complete(std::vector<uint8_t> data) {
|
||||
return;
|
||||
tonic::DartState::Scope scope(dart_state);
|
||||
|
||||
Dart_Handle byte_buffer = Dart_NewTypedData(
|
||||
Dart_TypedData_kByteData, data.size());
|
||||
Dart_Handle byte_buffer =
|
||||
Dart_NewTypedData(Dart_TypedData_kByteData, data.size());
|
||||
DART_CHECK_VALID(byte_buffer);
|
||||
|
||||
void* buffer;
|
||||
@@ -60,8 +60,8 @@ void PlatformMessageResponseDart::CompleteEmpty() {
|
||||
return;
|
||||
FXL_DCHECK(!is_complete_);
|
||||
is_complete_ = true;
|
||||
Threads::UI()->PostTask(fxl::MakeCopyable(
|
||||
[ callback = std::move(callback_) ]() mutable {
|
||||
Threads::UI()->PostTask(
|
||||
fxl::MakeCopyable([callback = std::move(callback_)]() mutable {
|
||||
tonic::DartState* dart_state = callback.dart_state().get();
|
||||
if (!dart_state)
|
||||
return;
|
||||
|
||||
@@ -40,7 +40,8 @@ Dart_Handle ToByteData(const std::vector<uint8_t>& buffer) {
|
||||
}
|
||||
|
||||
void DefaultRouteName(Dart_NativeArguments args) {
|
||||
std::string routeName = UIDartState::Current()->window()->client()->DefaultRouteName();
|
||||
std::string routeName =
|
||||
UIDartState::Current()->window()->client()->DefaultRouteName();
|
||||
Dart_SetReturnValue(args, StdStringToDart(routeName));
|
||||
}
|
||||
|
||||
@@ -155,11 +156,11 @@ void Window::UpdateLocale(const std::string& language_code,
|
||||
return;
|
||||
tonic::DartState::Scope scope(dart_state);
|
||||
|
||||
DartInvokeField(
|
||||
library_.value(), "_updateLocale",
|
||||
{
|
||||
StdStringToDart(language_code), StdStringToDart(country_code),
|
||||
});
|
||||
DartInvokeField(library_.value(), "_updateLocale",
|
||||
{
|
||||
StdStringToDart(language_code),
|
||||
StdStringToDart(country_code),
|
||||
});
|
||||
}
|
||||
|
||||
void Window::UpdateSemanticsEnabled(bool enabled) {
|
||||
@@ -177,9 +178,8 @@ void Window::DispatchPlatformMessage(fxl::RefPtr<PlatformMessage> message) {
|
||||
if (!dart_state)
|
||||
return;
|
||||
tonic::DartState::Scope scope(dart_state);
|
||||
Dart_Handle data_handle = (message->hasData())
|
||||
? ToByteData(message->data())
|
||||
: Dart_Null();
|
||||
Dart_Handle data_handle =
|
||||
(message->hasData()) ? ToByteData(message->data()) : Dart_Null();
|
||||
if (Dart_IsError(data_handle))
|
||||
return;
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ std::string ResolvePath(std::string path) {
|
||||
|
||||
} // namespace
|
||||
|
||||
DartController::DartController() : ui_dart_state_(nullptr),
|
||||
platform_kernel_bytes(nullptr) {}
|
||||
DartController::DartController()
|
||||
: ui_dart_state_(nullptr), platform_kernel_bytes(nullptr) {}
|
||||
|
||||
DartController::~DartController() {
|
||||
if (ui_dart_state_) {
|
||||
@@ -99,11 +99,11 @@ bool DartController::SendStartMessage(Dart_Handle root_library) {
|
||||
}
|
||||
|
||||
static void CopyVectorBytes(const std::vector<uint8_t>& vector,
|
||||
uint8_t*& bytes) {
|
||||
uint8_t*& bytes) {
|
||||
if (bytes) {
|
||||
free(bytes);
|
||||
}
|
||||
bytes = (uint8_t*) malloc(vector.size());
|
||||
bytes = (uint8_t*)malloc(vector.size());
|
||||
memcpy(bytes, vector.data(), vector.size());
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ tonic::DartErrorHandleType DartController::RunFromKernel(
|
||||
uint8_t* kernel_bytes = nullptr;
|
||||
CopyVectorBytes(kernel, kernel_bytes);
|
||||
|
||||
Dart_Handle result = Dart_LoadKernel(
|
||||
Dart_ReadKernelBinary(kernel_bytes, kernel.size()));
|
||||
Dart_Handle result =
|
||||
Dart_LoadKernel(Dart_ReadKernelBinary(kernel_bytes, kernel.size()));
|
||||
LogIfError(result);
|
||||
tonic::DartErrorHandleType error = tonic::GetErrorHandleType(result);
|
||||
if (SendStartMessage(Dart_RootLibrary())) {
|
||||
@@ -136,7 +136,8 @@ tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot() {
|
||||
}
|
||||
|
||||
tonic::DartErrorHandleType DartController::RunFromScriptSnapshot(
|
||||
const uint8_t* buffer, size_t size) {
|
||||
const uint8_t* buffer,
|
||||
size_t size) {
|
||||
tonic::DartState::Scope scope(dart_state());
|
||||
Dart_Handle result = Dart_LoadScriptFromSnapshot(buffer, size);
|
||||
LogIfError(result);
|
||||
@@ -148,7 +149,8 @@ tonic::DartErrorHandleType DartController::RunFromScriptSnapshot(
|
||||
}
|
||||
|
||||
tonic::DartErrorHandleType DartController::RunFromSource(
|
||||
const std::string& main, const std::string& packages) {
|
||||
const std::string& main,
|
||||
const std::string& packages) {
|
||||
tonic::DartState::Scope scope(dart_state());
|
||||
tonic::FileLoader& loader = dart_state()->file_loader();
|
||||
if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages)))
|
||||
@@ -162,11 +164,12 @@ tonic::DartErrorHandleType DartController::RunFromSource(
|
||||
return error;
|
||||
}
|
||||
|
||||
void DartController::CreateIsolateFor(const std::string& script_uri,
|
||||
const uint8_t* isolate_snapshot_data,
|
||||
const uint8_t* isolate_snapshot_instr,
|
||||
const std::vector<uint8_t>& platform_kernel,
|
||||
std::unique_ptr<UIDartState> state) {
|
||||
void DartController::CreateIsolateFor(
|
||||
const std::string& script_uri,
|
||||
const uint8_t* isolate_snapshot_data,
|
||||
const uint8_t* isolate_snapshot_instr,
|
||||
const std::vector<uint8_t>& platform_kernel,
|
||||
std::unique_ptr<UIDartState> state) {
|
||||
char* error = nullptr;
|
||||
|
||||
Dart_Isolate isolate;
|
||||
@@ -179,13 +182,13 @@ void DartController::CreateIsolateFor(const std::string& script_uri,
|
||||
isolate = Dart_CreateIsolateFromKernel(
|
||||
script_uri.c_str(), "main",
|
||||
Dart_ReadKernelBinary(platform_kernel_bytes, platform_kernel.size()),
|
||||
nullptr /* flags */,
|
||||
static_cast<tonic::DartState*>(state.get()), &error);
|
||||
nullptr /* flags */, static_cast<tonic::DartState*>(state.get()),
|
||||
&error);
|
||||
} else {
|
||||
isolate = Dart_CreateIsolate(
|
||||
script_uri.c_str(), "main", isolate_snapshot_data,
|
||||
isolate_snapshot_instr, nullptr,
|
||||
static_cast<tonic::DartState*>(state.get()), &error);
|
||||
isolate =
|
||||
Dart_CreateIsolate(script_uri.c_str(), "main", isolate_snapshot_data,
|
||||
isolate_snapshot_instr, nullptr,
|
||||
static_cast<tonic::DartState*>(state.get()), &error);
|
||||
}
|
||||
FXL_CHECK(isolate) << error;
|
||||
ui_dart_state_ = state.release();
|
||||
|
||||
@@ -49,6 +49,6 @@ class DartController {
|
||||
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(DartController);
|
||||
};
|
||||
}
|
||||
} // namespace blink
|
||||
|
||||
#endif // FLUTTER_RUNTIME_DART_CONTROLLER_H_
|
||||
|
||||
@@ -73,11 +73,8 @@ namespace {
|
||||
|
||||
// Arguments passed to the Dart VM in all configurations.
|
||||
static const char* kDartLanguageArgs[] = {
|
||||
"--enable_mirrors=false",
|
||||
"--background_compilation",
|
||||
"--await_is_keyword",
|
||||
"--assert_initializer",
|
||||
"--causal_async_stacks",
|
||||
"--enable_mirrors=false", "--background_compilation", "--await_is_keyword",
|
||||
"--assert_initializer", "--causal_async_stacks",
|
||||
};
|
||||
|
||||
static const char* kDartPrecompilationArgs[] = {
|
||||
@@ -110,8 +107,8 @@ static const char* kDartEndlessTraceBufferArgs[]{
|
||||
};
|
||||
|
||||
static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = {
|
||||
"--systrace_timeline",
|
||||
"--timeline_streams=VM,Isolate,Compiler,Dart,GC",
|
||||
"--systrace_timeline",
|
||||
"--timeline_streams=VM,Isolate,Compiler,Dart,GC",
|
||||
};
|
||||
|
||||
constexpr char kFileUriPrefix[] = "file://";
|
||||
@@ -186,7 +183,7 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri,
|
||||
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE
|
||||
// No VM-service in release mode.
|
||||
return nullptr;
|
||||
#else // FLUTTER_RUNTIME_MODE
|
||||
#else // FLUTTER_RUNTIME_MODE
|
||||
tonic::DartState* dart_state = new tonic::DartState();
|
||||
Dart_Isolate isolate = Dart_CreateIsolate(
|
||||
script_uri, "main", g_default_isolate_snapshot_data,
|
||||
@@ -227,7 +224,6 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri,
|
||||
#endif // FLUTTER_RUNTIME_MODE
|
||||
}
|
||||
|
||||
|
||||
Dart_Isolate IsolateCreateCallback(const char* script_uri,
|
||||
const char* main,
|
||||
const char* package_root,
|
||||
@@ -279,11 +275,14 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
|
||||
UIDartState* parent_dart_state = static_cast<UIDartState*>(callback_data);
|
||||
UIDartState* dart_state = parent_dart_state->CreateForChildIsolate();
|
||||
|
||||
Dart_Isolate isolate = kernel_platform != nullptr
|
||||
? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform,
|
||||
nullptr /* flags */, dart_state, error)
|
||||
: Dart_CreateIsolate(script_uri, main, g_default_isolate_snapshot_data,
|
||||
g_default_isolate_snapshot_instructions, nullptr, dart_state, error);
|
||||
Dart_Isolate isolate =
|
||||
kernel_platform != nullptr
|
||||
? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform,
|
||||
nullptr /* flags */, dart_state, error)
|
||||
: Dart_CreateIsolate(script_uri, main,
|
||||
g_default_isolate_snapshot_data,
|
||||
g_default_isolate_snapshot_instructions, nullptr,
|
||||
dart_state, error);
|
||||
FXL_CHECK(isolate) << error;
|
||||
dart_state->SetIsolate(isolate);
|
||||
FXL_CHECK(!LogIfError(
|
||||
@@ -302,8 +301,8 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
|
||||
|
||||
if (!kernel_data.empty()) {
|
||||
// We are running kernel code.
|
||||
FXL_CHECK(!LogIfError(Dart_LoadKernel(Dart_ReadKernelBinary(kernel_data.data(),
|
||||
kernel_data.size()))));
|
||||
FXL_CHECK(!LogIfError(Dart_LoadKernel(
|
||||
Dart_ReadKernelBinary(kernel_data.data(), kernel_data.size()))));
|
||||
} else if (!snapshot_data.empty()) {
|
||||
// We are running from a script snapshot.
|
||||
FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(),
|
||||
@@ -573,7 +572,7 @@ void InitDartVM(const uint8_t* vm_snapshot_data,
|
||||
0, // argument_count
|
||||
nullptr, // argument_names
|
||||
nullptr // argument_values
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#define FLUTTER_RUNTIME_DART_INIT_H_
|
||||
|
||||
#include "dart/runtime/include/dart_api.h"
|
||||
#include "lib/fxl/functional/closure.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/functional/closure.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace flutter {
|
||||
namespace runtime {
|
||||
extern ResourcesEntry __flutter_embedded_service_isolate_resources_[];
|
||||
}
|
||||
}
|
||||
} // namespace flutter
|
||||
|
||||
namespace blink {
|
||||
namespace {
|
||||
@@ -66,7 +66,8 @@ void DartServiceIsolate::TriggerResourceLoad(Dart_NativeArguments args) {
|
||||
|
||||
void DartServiceIsolate::NotifyServerState(Dart_NativeArguments args) {
|
||||
Dart_Handle exception = nullptr;
|
||||
std::string uri = tonic::DartConverter<std::string>::FromArguments(args, 0, exception);
|
||||
std::string uri =
|
||||
tonic::DartConverter<std::string>::FromArguments(args, 0, exception);
|
||||
if (!exception) {
|
||||
observatory_uri_ = uri;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#ifndef FLUTTER_RUNTIME_PLATFORM_IMPL_H_
|
||||
#define FLUTTER_RUNTIME_PLATFORM_IMPL_H_
|
||||
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "flutter/sky/engine/public/platform/Platform.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ RuntimeController::RuntimeController(RuntimeDelegate* client)
|
||||
RuntimeController::~RuntimeController() {}
|
||||
|
||||
void RuntimeController::CreateDartController(
|
||||
const std::string& script_uri, const uint8_t* isolate_snapshot_data,
|
||||
const std::string& script_uri,
|
||||
const uint8_t* isolate_snapshot_data,
|
||||
const uint8_t* isolate_snapshot_instr,
|
||||
const std::vector<uint8_t>& platform_kernel) {
|
||||
FXL_DCHECK(!dart_controller_);
|
||||
|
||||
@@ -27,13 +27,12 @@ PassRefPtr<FontData> TestFontSelector::getFontData(
|
||||
|
||||
bool syntheticBold = (fontDescription.weight() >= FontWeight600 ||
|
||||
fontDescription.isSyntheticBold());
|
||||
bool syntheticItalic = (fontDescription.style() ||
|
||||
fontDescription.isSyntheticItalic());
|
||||
FontPlatformData platform_data(test_typeface_, "Ahem",
|
||||
fontDescription.effectiveFontSize(),
|
||||
syntheticBold, syntheticItalic,
|
||||
fontDescription.orientation(),
|
||||
fontDescription.useSubpixelPositioning());
|
||||
bool syntheticItalic =
|
||||
(fontDescription.style() || fontDescription.isSyntheticItalic());
|
||||
FontPlatformData platform_data(
|
||||
test_typeface_, "Ahem", fontDescription.effectiveFontSize(),
|
||||
syntheticBold, syntheticItalic, fontDescription.orientation(),
|
||||
fontDescription.useSubpixelPositioning());
|
||||
|
||||
return SimpleFontData::create(platform_data, CustomFontData::create());
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
#include "flutter/shell/common/animator.h"
|
||||
|
||||
#include "dart/runtime/include/dart_tools_api.h"
|
||||
#include "flutter/common/threads.h"
|
||||
#include "flutter/fml/trace_event.h"
|
||||
#include "lib/fxl/time/stopwatch.h"
|
||||
#include "dart/runtime/include/dart_tools_api.h"
|
||||
|
||||
namespace shell {
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@ namespace flutter {
|
||||
namespace runtime {
|
||||
extern ResourcesEntry __sky_embedder_diagnostic_server_resources_[];
|
||||
}
|
||||
}
|
||||
} // namespace flutter
|
||||
|
||||
namespace shell {
|
||||
|
||||
using tonic::DartLibraryNatives;
|
||||
using blink::EmbedderResources;
|
||||
using tonic::DartInvokeField;
|
||||
using tonic::DartLibraryNatives;
|
||||
using tonic::LogIfError;
|
||||
using tonic::ToDart;
|
||||
|
||||
|
||||
@@ -85,7 +85,8 @@ class Engine : public blink::RuntimeDelegate {
|
||||
void StartAnimatorIfPossible();
|
||||
|
||||
void ConfigureAssetBundle(const std::string& path);
|
||||
void ConfigureRuntime(const std::string& script_uri,
|
||||
void ConfigureRuntime(
|
||||
const std::string& script_uri,
|
||||
const std::vector<uint8_t>& platform_kernel = std::vector<uint8_t>());
|
||||
|
||||
bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message);
|
||||
|
||||
@@ -83,8 +83,7 @@ class PlatformView : public std::enable_shared_from_this<PlatformView> {
|
||||
std::unique_ptr<VsyncWaiter> vsync_waiter_;
|
||||
SkISize size_;
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView);
|
||||
};
|
||||
|
||||
|
||||
@@ -326,11 +326,11 @@ const char* PlatformViewServiceProtocol::kFlushUIThreadTasksExtensionName =
|
||||
// It should be invoked from the VM Service and and blocks it until UI thread
|
||||
// tasks are processed.
|
||||
bool PlatformViewServiceProtocol::FlushUIThreadTasks(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) {
|
||||
fxl::AutoResetWaitableEvent latch;
|
||||
blink::Threads::UI()->PostTask([&latch]() {
|
||||
// This task is empty because we just need to synchronize this RPC with the
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include "flutter/shell/common/vsync_waiter_fallback.h"
|
||||
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "flutter/common/threads.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
namespace shell {
|
||||
namespace {
|
||||
|
||||
@@ -128,13 +128,9 @@ bool AndroidContextGL::CreateWindowSurface(
|
||||
window_ = std::move(window);
|
||||
EGLDisplay display = environment_->Display();
|
||||
|
||||
const EGLint srgb_attribs[] = {
|
||||
EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR,
|
||||
EGL_NONE
|
||||
};
|
||||
const EGLint default_attribs[] = {
|
||||
EGL_NONE
|
||||
};
|
||||
const EGLint srgb_attribs[] = {EGL_GL_COLORSPACE_KHR,
|
||||
EGL_GL_COLORSPACE_SRGB_KHR, EGL_NONE};
|
||||
const EGLint default_attribs[] = {EGL_NONE};
|
||||
|
||||
const EGLint* attribs = default_attribs;
|
||||
if (srgb_support_) {
|
||||
@@ -154,17 +150,14 @@ bool AndroidContextGL::CreatePBufferSurface() {
|
||||
|
||||
EGLDisplay display = environment_->Display();
|
||||
|
||||
const EGLint srgb_attribs[] = {
|
||||
EGL_WIDTH, 1,
|
||||
EGL_HEIGHT, 1,
|
||||
EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR,
|
||||
EGL_NONE
|
||||
};
|
||||
const EGLint default_attribs[] = {
|
||||
EGL_WIDTH, 1,
|
||||
EGL_HEIGHT, 1,
|
||||
EGL_NONE
|
||||
};
|
||||
const EGLint srgb_attribs[] = {EGL_WIDTH,
|
||||
1,
|
||||
EGL_HEIGHT,
|
||||
1,
|
||||
EGL_GL_COLORSPACE_KHR,
|
||||
EGL_GL_COLORSPACE_SRGB_KHR,
|
||||
EGL_NONE};
|
||||
const EGLint default_attribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE};
|
||||
|
||||
const EGLint* attribs = default_attribs;
|
||||
if (srgb_support_) {
|
||||
@@ -231,12 +224,14 @@ AndroidContextGL::AndroidContextGL(fxl::RefPtr<AndroidEnvironmentGL> env,
|
||||
|
||||
AndroidContextGL::~AndroidContextGL() {
|
||||
if (!TeardownContext(environment_->Display(), context_)) {
|
||||
FXL_LOG(ERROR) << "Could not tear down the EGL context. Possible resource leak.";
|
||||
FXL_LOG(ERROR)
|
||||
<< "Could not tear down the EGL context. Possible resource leak.";
|
||||
LogLastEGLError();
|
||||
}
|
||||
|
||||
if (!TeardownSurface(environment_->Display(), surface_)) {
|
||||
FXL_LOG(ERROR) << "Could not tear down the EGL surface. Possible resource leak.";
|
||||
FXL_LOG(ERROR)
|
||||
<< "Could not tear down the EGL surface. Possible resource leak.";
|
||||
LogLastEGLError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ namespace shell {
|
||||
|
||||
class AndroidContextGL : public fxl::RefCountedThreadSafe<AndroidContextGL> {
|
||||
public:
|
||||
|
||||
bool CreateWindowSurface(fxl::RefPtr<AndroidNativeWindow> window);
|
||||
|
||||
bool CreatePBufferSurface();
|
||||
|
||||
@@ -34,8 +34,7 @@ bool GetSkColorType(int32_t buffer_format, SkColorType* color_type) {
|
||||
} // anonymous namespace
|
||||
|
||||
AndroidSurfaceSoftware::AndroidSurfaceSoftware()
|
||||
: AndroidSurface(),
|
||||
target_color_type_(kRGBA_8888_SkColorType) {}
|
||||
: AndroidSurface(), target_color_type_(kRGBA_8888_SkColorType) {}
|
||||
|
||||
AndroidSurfaceSoftware::~AndroidSurfaceSoftware() = default;
|
||||
|
||||
@@ -102,20 +101,19 @@ bool AndroidSurfaceSoftware::PresentBackingStore(
|
||||
|
||||
SkColorType color_type;
|
||||
if (GetSkColorType(native_buffer.format, &color_type)) {
|
||||
SkImageInfo native_image_info = SkImageInfo::Make(
|
||||
native_buffer.width, native_buffer.height, color_type, kPremul_SkAlphaType);
|
||||
SkImageInfo native_image_info =
|
||||
SkImageInfo::Make(native_buffer.width, native_buffer.height, color_type,
|
||||
kPremul_SkAlphaType);
|
||||
|
||||
std::unique_ptr<SkCanvas> canvas = SkCanvas::MakeRasterDirect(
|
||||
native_image_info,
|
||||
native_buffer.bits,
|
||||
native_image_info, native_buffer.bits,
|
||||
native_buffer.stride * SkColorTypeBytesPerPixel(color_type));
|
||||
|
||||
if (canvas) {
|
||||
SkBitmap bitmap;
|
||||
if (bitmap.installPixels(pixmap)) {
|
||||
canvas->drawBitmapRect(
|
||||
bitmap,
|
||||
SkRect::MakeIWH(native_buffer.width, native_buffer.height),
|
||||
bitmap, SkRect::MakeIWH(native_buffer.width, native_buffer.height),
|
||||
nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,19 +115,19 @@ static std::unique_ptr<AndroidSurface> InitializePlatformSurface() {
|
||||
}
|
||||
|
||||
if (auto surface = InitializePlatformSurfaceSoftware()) {
|
||||
FXL_DLOG(INFO) << "Software surface initialized.";
|
||||
return surface;
|
||||
FXL_DLOG(INFO) << "Software surface initialized.";
|
||||
return surface;
|
||||
}
|
||||
|
||||
FXL_CHECK(false) << "Could not initialize either the Vulkan, OpenGL, or Software"
|
||||
"surface backends. Flutter requires a GPU to render.";
|
||||
FXL_CHECK(false)
|
||||
<< "Could not initialize either the Vulkan, OpenGL, or Software"
|
||||
"surface backends. Flutter requires a GPU to render.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PlatformViewAndroid::PlatformViewAndroid()
|
||||
: PlatformView(std::make_unique<GPURasterizer>(nullptr)),
|
||||
android_surface_(InitializePlatformSurface()) {
|
||||
}
|
||||
android_surface_(InitializePlatformSurface()) {}
|
||||
|
||||
PlatformViewAndroid::~PlatformViewAndroid() = default;
|
||||
|
||||
@@ -141,14 +141,13 @@ void PlatformViewAndroid::Attach() {
|
||||
|
||||
PostAddToShellTask();
|
||||
|
||||
rasterizer_->AddNextFrameCallback(
|
||||
[this]() {
|
||||
JNIEnv* env = fml::jni::AttachCurrentThread();
|
||||
fml::jni::ScopedJavaLocalRef<jobject> view = flutter_view_.get(env);
|
||||
if (!view.is_null()) {
|
||||
FlutterViewOnFirstFrame(env, view.obj());
|
||||
}
|
||||
});
|
||||
rasterizer_->AddNextFrameCallback([this]() {
|
||||
JNIEnv* env = fml::jni::AttachCurrentThread();
|
||||
fml::jni::ScopedJavaLocalRef<jobject> view = flutter_view_.get(env);
|
||||
if (!view.is_null()) {
|
||||
FlutterViewOnFirstFrame(env, view.obj());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void PlatformViewAndroid::Detach() {
|
||||
|
||||
@@ -102,7 +102,6 @@ class PlatformViewAndroid : public PlatformView {
|
||||
android_surface_->SetFlutterView(flutter_view);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const std::unique_ptr<AndroidSurface> android_surface_;
|
||||
fml::jni::JavaObjectWeakGlobalRef flutter_view_;
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
#include "lib/fxl/arraysize.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
#define PLATFORM_VIEW (*reinterpret_cast<std::shared_ptr<PlatformViewAndroid>*>(platform_view))
|
||||
#define PLATFORM_VIEW \
|
||||
(*reinterpret_cast<std::shared_ptr<PlatformViewAndroid>*>(platform_view))
|
||||
|
||||
namespace shell {
|
||||
|
||||
@@ -107,7 +108,7 @@ static void RunBundleAndSnapshot(JNIEnv* env,
|
||||
return PLATFORM_VIEW->RunBundleAndSnapshot(
|
||||
fml::jni::JavaStringToString(env, bundlePath), //
|
||||
fml::jni::JavaStringToString(env, snapshotOverride) //
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void RunBundleAndSource(JNIEnv* env,
|
||||
|
||||
@@ -41,12 +41,13 @@ void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos,
|
||||
int64_t frameTargetTimeNanos) {
|
||||
Callback callback = std::move(callback_);
|
||||
callback_ = Callback();
|
||||
blink::Threads::UI()->PostTask([callback, frameTimeNanos, frameTargetTimeNanos] {
|
||||
callback(fxl::TimePoint::FromEpochDelta(
|
||||
fxl::TimeDelta::FromNanoseconds(frameTimeNanos)),
|
||||
fxl::TimePoint::FromEpochDelta(
|
||||
fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos)));
|
||||
});
|
||||
blink::Threads::UI()->PostTask(
|
||||
[callback, frameTimeNanos, frameTargetTimeNanos] {
|
||||
callback(fxl::TimePoint::FromEpochDelta(
|
||||
fxl::TimeDelta::FromNanoseconds(frameTimeNanos)),
|
||||
fxl::TimePoint::FromEpochDelta(
|
||||
fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos)));
|
||||
});
|
||||
}
|
||||
|
||||
static void OnNativeVsync(JNIEnv* env,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_VSYNC_WAITER_MAC_H_
|
||||
#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_VSYNC_WAITER_MAC_H_
|
||||
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "flutter/shell/common/vsync_waiter.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace shell {
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "FlutterCodecs.h"
|
||||
#include "FlutterDartProject.h"
|
||||
#include "FlutterMacros.h"
|
||||
#include "FlutterNavigationController.h"
|
||||
#include "FlutterPlugin.h"
|
||||
#include "FlutterViewController.h"
|
||||
#include "FlutterNavigationController.h"
|
||||
|
||||
#endif // FLUTTER_FLUTTER_H_
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
* code as necessary from FlutterAppDelegate.mm.
|
||||
*/
|
||||
FLUTTER_EXPORT
|
||||
@interface FlutterAppDelegate
|
||||
: UIResponder<UIApplicationDelegate, FlutterPluginRegistry>
|
||||
@interface FlutterAppDelegate : UIResponder<UIApplicationDelegate, FlutterPluginRegistry>
|
||||
|
||||
@property(strong, nonatomic) UIWindow* window;
|
||||
|
||||
@@ -33,7 +32,7 @@ FLUTTER_EXPORT
|
||||
// typically a FlutterViewController, for plugin interop.
|
||||
//
|
||||
// Defaults to window's rootViewController.
|
||||
- (NSObject<FlutterBinaryMessenger>*) binaryMessenger;
|
||||
- (NSObject<FlutterBinaryMessenger>*)binaryMessenger;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface FlutterNavigationController: UINavigationController
|
||||
@interface FlutterNavigationController : UINavigationController
|
||||
|
||||
@end
|
||||
|
||||
@@ -160,9 +160,7 @@
|
||||
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options {
|
||||
for (id<FlutterPlugin> plugin in _pluginDelegates) {
|
||||
if ([plugin respondsToSelector:_cmd]) {
|
||||
if ([plugin application:application
|
||||
openURL:url
|
||||
options:options]) {
|
||||
if ([plugin application:application openURL:url options:options]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
} else {
|
||||
// NSJSONSerialization does not support top-level simple values.
|
||||
// We encode as singleton array, then extract the relevant bytes.
|
||||
encoding = [NSJSONSerialization dataWithJSONObject:@[message] options:0 error:nil];
|
||||
encoding = [NSJSONSerialization dataWithJSONObject:@[ message ] options:0 error:nil];
|
||||
if (encoding) {
|
||||
encoding = [encoding subdataWithRange:NSMakeRange(1, encoding.length - 2)];
|
||||
}
|
||||
@@ -96,7 +96,7 @@
|
||||
decoded = [NSJSONSerialization JSONObjectWithData:message options:0 error:nil];
|
||||
}
|
||||
NSAssert(decoded, @"Invalid JSON message, decoding failed");
|
||||
return isSimpleValue ? ((NSArray*) decoded)[0] : decoded;
|
||||
return isSimpleValue ? ((NSArray*)decoded)[0] : decoded;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
}
|
||||
|
||||
- (NSData*)encodeSuccessEnvelope:(id)result {
|
||||
return [[FlutterJSONMessageCodec sharedInstance] encode:@[[self wrapNil:result]]];
|
||||
return [[FlutterJSONMessageCodec sharedInstance] encode:@[ [self wrapNil:result] ]];
|
||||
}
|
||||
|
||||
- (NSData*)encodeErrorEnvelope:(FlutterError*)error {
|
||||
|
||||
@@ -182,11 +182,11 @@ static NSString* NSStringFromVMType(VMType type) {
|
||||
|
||||
if (_vmTypeRequirement != embedderVMType) {
|
||||
NSString* message =
|
||||
[NSString stringWithFormat:@"Could not load the project because of differing project type. "
|
||||
@"The project can run in '%@' but the embedder is configured as "
|
||||
@"'%@'",
|
||||
NSStringFromVMType(_vmTypeRequirement),
|
||||
NSStringFromVMType(embedderVMType)];
|
||||
[NSString stringWithFormat:
|
||||
@"Could not load the project because of differing project type. "
|
||||
@"The project can run in '%@' but the embedder is configured as "
|
||||
@"'%@'",
|
||||
NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)];
|
||||
result(NO, message);
|
||||
return;
|
||||
}
|
||||
@@ -218,9 +218,10 @@ static NSString* NSStringFromVMType(VMType type) {
|
||||
|
||||
NSString* path = [self pathForFLXFromBundle:_precompiledDartBundle];
|
||||
if (path.length == 0) {
|
||||
NSString* message = [NSString stringWithFormat:@"Could not find the 'app.flx' archive in "
|
||||
@"the precompiled Dart bundle with ID '%@'",
|
||||
_precompiledDartBundle.bundleIdentifier];
|
||||
NSString* message = [NSString stringWithFormat:
|
||||
@"Could not find the 'app.flx' archive in "
|
||||
@"the precompiled Dart bundle with ID '%@'",
|
||||
_precompiledDartBundle.bundleIdentifier];
|
||||
result(NO, message);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@implementation FlutterNavigationController
|
||||
|
||||
- (void) viewWillAppear:(BOOL)animated {
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[self setNavigationBarHidden:YES];
|
||||
[super viewWillAppear:animated];
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ using namespace shell;
|
||||
// in the navigation hierarchy.
|
||||
UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
|
||||
if ([viewController isKindOfClass:[UINavigationController class]]) {
|
||||
[((UINavigationController*)viewController) popViewControllerAnimated:NO];
|
||||
[((UINavigationController*)viewController) popViewControllerAnimated:NO];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,6 @@ using namespace shell;
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)setClipboardData:(NSDictionary*)data {
|
||||
UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
|
||||
pasteboard.string = data[@"text"];
|
||||
|
||||
@@ -127,8 +127,8 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
|
||||
|
||||
_orientationPreferences = UIInterfaceOrientationMaskAll;
|
||||
_statusBarStyle = UIStatusBarStyleDefault;
|
||||
_platformView = std::make_shared<shell::PlatformViewIOS>(
|
||||
reinterpret_cast<CAEAGLLayer*>(self.view.layer));
|
||||
_platformView =
|
||||
std::make_shared<shell::PlatformViewIOS>(reinterpret_cast<CAEAGLLayer*>(self.view.layer));
|
||||
|
||||
_platformView->Attach(
|
||||
// First frame callback.
|
||||
@@ -136,11 +136,13 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
|
||||
TRACE_EVENT0("flutter", "First Frame");
|
||||
if (_launchView) {
|
||||
[UIView animateWithDuration:0.2
|
||||
animations:^{ _launchView.get().alpha = 0; }
|
||||
completion:^(BOOL finished){
|
||||
[_launchView.get() removeFromSuperview];
|
||||
_launchView.reset();
|
||||
}];
|
||||
animations:^{
|
||||
_launchView.get().alpha = 0;
|
||||
}
|
||||
completion:^(BOOL finished) {
|
||||
[_launchView.get() removeFromSuperview];
|
||||
_launchView.reset();
|
||||
}];
|
||||
}
|
||||
});
|
||||
_platformView->SetupResourceContextOnIOThread();
|
||||
@@ -298,8 +300,8 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
|
||||
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchStoryboardName"];
|
||||
if (launchStoryboardName && !self.isBeingPresented && !self.isMovingToParentViewController) {
|
||||
UIViewController* launchViewController =
|
||||
[[UIStoryboard storyboardWithName:launchStoryboardName
|
||||
bundle:nil] instantiateInitialViewController];
|
||||
[[UIStoryboard storyboardWithName:launchStoryboardName bundle:nil]
|
||||
instantiateInitialViewController];
|
||||
_launchView.reset([launchViewController.view retain]);
|
||||
_launchView.get().frame = self.view.bounds;
|
||||
_launchView.get().autoresizingMask =
|
||||
|
||||
@@ -55,7 +55,8 @@ class AccessibilityBridge final {
|
||||
|
||||
private:
|
||||
SemanticsObject* GetOrCreateObject(int32_t id);
|
||||
void VisitObjectsRecursivelyAndRemove(SemanticsObject* object, NSMutableArray<NSNumber*>* doomed_uids);
|
||||
void VisitObjectsRecursivelyAndRemove(SemanticsObject* object,
|
||||
NSMutableArray<NSNumber*>* doomed_uids);
|
||||
void ReleaseObjects(std::unordered_map<int, SemanticsObject*>& objects);
|
||||
|
||||
UIView* view_;
|
||||
|
||||
@@ -48,7 +48,7 @@ TEST(FlutterJSONCodec, CanEncodeAndDecodeNil) {
|
||||
}
|
||||
|
||||
TEST(FlutterJSONCodec, CanEncodeAndDecodeArray) {
|
||||
NSArray* value = @[ [NSNull null], @"hello", @3.14, @47, @{ @"a" : @"nested" } ];
|
||||
NSArray* value = @[ [NSNull null], @"hello", @3.14, @47, @{@"a" : @"nested"} ];
|
||||
FlutterJSONMessageCodec* codec = [FlutterJSONMessageCodec sharedInstance];
|
||||
NSData* encoded = [codec encode:value];
|
||||
NSArray* decoded = [codec decode:encoded];
|
||||
|
||||
@@ -20,10 +20,12 @@ class PlatformMessageRouter {
|
||||
|
||||
void HandlePlatformMessage(fxl::RefPtr<blink::PlatformMessage> message);
|
||||
|
||||
void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler);
|
||||
void SetMessageHandler(const std::string& channel,
|
||||
FlutterBinaryMessageHandler handler);
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, FlutterBinaryMessageHandler> message_handlers_;
|
||||
std::unordered_map<std::string, FlutterBinaryMessageHandler>
|
||||
message_handlers_;
|
||||
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter);
|
||||
};
|
||||
|
||||
@@ -34,9 +34,7 @@ class IOSGLContext {
|
||||
|
||||
bool ResourceMakeCurrent();
|
||||
|
||||
sk_sp<SkColorSpace> ColorSpace() const {
|
||||
return color_space_;
|
||||
}
|
||||
sk_sp<SkColorSpace> ColorSpace() const { return color_space_; }
|
||||
|
||||
private:
|
||||
fml::scoped_nsobject<CAEAGLLayer> layer_;
|
||||
|
||||
@@ -106,19 +106,16 @@ IOSGLContext::IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* laye
|
||||
// should use iOS APIs to perform the final correction step based on the
|
||||
// device properties. Ex: We can indicate that we have rendered in P3, and
|
||||
// the framework will do the final adjustment for us.
|
||||
NSOperatingSystemVersion version = [[NSProcessInfo processInfo]
|
||||
operatingSystemVersion];
|
||||
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
|
||||
color_space_ = SkColorSpace::MakeSRGB();
|
||||
if (version.majorVersion >= 10) {
|
||||
UIDisplayGamut displayGamut =
|
||||
[UIScreen mainScreen].traitCollection.displayGamut;
|
||||
UIDisplayGamut displayGamut = [UIScreen mainScreen].traitCollection.displayGamut;
|
||||
switch (displayGamut) {
|
||||
case UIDisplayGamutP3:
|
||||
// Should we consider using more than 8-bits of precision given that
|
||||
// P3 specifies a wider range of colors?
|
||||
color_space_ = SkColorSpace::MakeRGB(
|
||||
SkColorSpace::kSRGB_RenderTargetGamma,
|
||||
SkColorSpace::kDCIP3_D65_Gamut);
|
||||
color_space_ = SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma,
|
||||
SkColorSpace::kDCIP3_D65_Gamut);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -154,7 +151,8 @@ bool IOSGLContext::IsValid() const {
|
||||
|
||||
bool IOSGLContext::PresentRenderBuffer() const {
|
||||
const GLenum discards[] = {
|
||||
GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT,
|
||||
GL_DEPTH_ATTACHMENT,
|
||||
GL_STENCIL_ATTACHMENT,
|
||||
};
|
||||
|
||||
glDiscardFramebufferEXT(GL_FRAMEBUFFER, sizeof(discards) / sizeof(GLenum), discards);
|
||||
|
||||
@@ -63,8 +63,7 @@ sk_sp<SkSurface> IOSSurfaceSoftware::AcquireBackingStore(const SkISize& size) {
|
||||
return sk_surface_;
|
||||
}
|
||||
|
||||
SkImageInfo info = SkImageInfo::MakeS32(size.fWidth, size.fHeight,
|
||||
kPremul_SkAlphaType);
|
||||
SkImageInfo info = SkImageInfo::MakeS32(size.fWidth, size.fHeight, kPremul_SkAlphaType);
|
||||
sk_surface_ = SkSurface::MakeRaster(info, nullptr);
|
||||
return sk_surface_;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@ namespace shell {
|
||||
PlatformViewIOS::PlatformViewIOS(CALayer* layer)
|
||||
: PlatformView(std::make_unique<GPURasterizer>(std::make_unique<ProcessInfoMac>())),
|
||||
ios_surface_(IOSSurface::Create(surface_config_, layer)),
|
||||
weak_factory_(this) {
|
||||
}
|
||||
weak_factory_(this) {}
|
||||
|
||||
PlatformViewIOS::~PlatformViewIOS() = default;
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
namespace shell {
|
||||
|
||||
PlatformViewTest::PlatformViewTest()
|
||||
: PlatformView(std::unique_ptr<Rasterizer>(new NullRasterizer())) {
|
||||
}
|
||||
: PlatformView(std::unique_ptr<Rasterizer>(new NullRasterizer())) {}
|
||||
|
||||
void PlatformViewTest::Attach() {
|
||||
CreateEngine();
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
|
||||
namespace shell {
|
||||
|
||||
TestRunner::TestRunner() : platform_view_(std::make_shared<PlatformViewTest>()) {
|
||||
TestRunner::TestRunner()
|
||||
: platform_view_(std::make_shared<PlatformViewTest>()) {
|
||||
platform_view_->Attach();
|
||||
blink::ViewportMetrics metrics;
|
||||
metrics.device_pixel_ratio = 3.0;
|
||||
metrics.physical_width = 2400; // 800 at 3x resolution
|
||||
metrics.physical_height = 1800; // 600 at 3x resolution
|
||||
metrics.physical_width = 2400; // 800 at 3x resolution
|
||||
metrics.physical_height = 1800; // 600 at 3x resolution
|
||||
|
||||
blink::Threads::UI()->PostTask(
|
||||
[ engine = platform_view_->engine().GetWeakPtr(), metrics ] {
|
||||
|
||||
@@ -2798,7 +2798,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
|
||||
Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
|
||||
All rights reserved.
|
||||
Copyright (C) 2013 Google Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -3138,7 +3139,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.
|
||||
Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -3370,7 +3372,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.
|
||||
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
|
||||
rights reserved.
|
||||
Copyright (C) 2005 Alexey Proskuryakov.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -4340,7 +4343,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
|
||||
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -5404,7 +5408,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
Copyright (C) 2008, 2009 Paul Pedriana <ppedriana@ea.com>. All rights reserved.
|
||||
Copyright (C) 2008, 2009 Paul Pedriana <ppedriana@ea.com>.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -6121,16 +6126,16 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -6299,16 +6304,17 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -6721,16 +6727,16 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -6825,16 +6831,16 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -7040,16 +7046,16 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -7185,16 +7191,16 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -7234,16 +7240,16 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -7258,16 +7264,16 @@ are met:
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES,:tabnew INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES,:tabnew INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
@@ -7302,7 +7308,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
engine
|
||||
|
||||
Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
|
||||
Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights reserved.
|
||||
Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc.
|
||||
All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose without fee is hereby granted, provided that this entire notice
|
||||
@@ -7319,7 +7326,8 @@ engine
|
||||
|
||||
Copyright (c) 2005, 2007, Google Inc.
|
||||
All rights reserved.
|
||||
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
|
||||
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
@@ -8012,36 +8020,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
Copyright 2013 The Chromium Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
|
||||
Copyright 2017 The Flutter Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -8556,6 +8534,37 @@ That's all there is to it!
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
garnet
|
||||
|
||||
Copyright 2013 The Chromium Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
garnet
|
||||
icu
|
||||
|
||||
Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
@@ -8607,6 +8616,39 @@ distribution.
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
garnet
|
||||
icu
|
||||
skia
|
||||
|
||||
Copyright 2016 The Chromium Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
@@ -9189,38 +9231,6 @@ necessary. Here is a sample; alter the names:
|
||||
|
||||
That's all there is to it!
|
||||
--------------------------------------------------------------------------------
|
||||
engine
|
||||
icu
|
||||
skia
|
||||
|
||||
Copyright 2016 The Chromium Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
etc1
|
||||
observatory_pub_packages
|
||||
skia
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "lib/fxl/compiler_specific.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/time/time_delta.h"
|
||||
#include "lib/fxl/compiler_specific.h"
|
||||
|
||||
namespace flutter {
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "txt/asset_font_manager.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
namespace txt {
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "txt/directory_asset_data_provider.h"
|
||||
#include <dirent.h>
|
||||
#include <sstream>
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "third_party/skia/include/core/SkStream.h"
|
||||
#include "third_party/skia/include/core/SkTypeface.h"
|
||||
#include "txt/directory_asset_data_provider.h"
|
||||
|
||||
namespace txt {
|
||||
|
||||
|
||||
@@ -350,15 +350,14 @@ void Paragraph::Layout(double width, bool force) {
|
||||
(lines_ == max_lines - 1 ||
|
||||
max_lines == std::numeric_limits<size_t>::max())) {
|
||||
float ellipsis_width = layout.measureText(
|
||||
reinterpret_cast<const uint16_t*>(ellipsis.data()),
|
||||
0, ellipsis.length(), ellipsis.length(), bidiFlags,
|
||||
font, minikin_paint, minikin_font_collection, nullptr);
|
||||
reinterpret_cast<const uint16_t*>(ellipsis.data()), 0,
|
||||
ellipsis.length(), ellipsis.length(), bidiFlags, font,
|
||||
minikin_paint, minikin_font_collection, nullptr);
|
||||
|
||||
std::vector<float> text_advances(text_count);
|
||||
float text_width = layout.measureText(
|
||||
text.data() + layout_start, 0, text_count, text_count,
|
||||
bidiFlags, font, minikin_paint, minikin_font_collection,
|
||||
text_advances.data());
|
||||
text.data() + layout_start, 0, text_count, text_count, bidiFlags,
|
||||
font, minikin_paint, minikin_font_collection, text_advances.data());
|
||||
|
||||
// Truncate characters from the text until the ellipsis fits.
|
||||
size_t truncate_count = 0;
|
||||
@@ -368,12 +367,13 @@ void Paragraph::Layout(double width, bool force) {
|
||||
truncate_count++;
|
||||
}
|
||||
|
||||
ellipsized_text.reserve(text_count - truncate_count + ellipsis.length());
|
||||
ellipsized_text.reserve(text_count - truncate_count +
|
||||
ellipsis.length());
|
||||
ellipsized_text.insert(ellipsized_text.begin(),
|
||||
text.begin() + layout_start,
|
||||
text.begin() + layout_end - truncate_count);
|
||||
ellipsized_text.insert(ellipsized_text.end(),
|
||||
ellipsis.begin(), ellipsis.end());
|
||||
ellipsized_text.insert(ellipsized_text.end(), ellipsis.begin(),
|
||||
ellipsis.end());
|
||||
text_ptr = ellipsized_text.data();
|
||||
text_count = ellipsized_text.size();
|
||||
|
||||
@@ -388,8 +388,8 @@ void Paragraph::Layout(double width, bool force) {
|
||||
// However, this is not significant for reasonably sized paragraphs. It is
|
||||
// currently recommended to break up very long paragraphs (10k+
|
||||
// characters) to ensure speedy layout.
|
||||
layout.doLayout(text_ptr, 0, text_count, text_count,
|
||||
bidiFlags, font, minikin_paint, minikin_font_collection);
|
||||
layout.doLayout(text_ptr, 0, text_count, text_count, bidiFlags, font,
|
||||
minikin_paint, minikin_font_collection);
|
||||
FillWhitespaceSet(layout_start, layout_end,
|
||||
minikin::getHbFontLocked(layout.getFont(0)));
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ static std::vector<uint8_t> buildCmapFormat4Table(
|
||||
uint16_t segmentCount = ranges.size() / 2 + 1 /* +1 for end marker */;
|
||||
|
||||
const size_t numOfUint16 =
|
||||
8 /* format, length, languages, segCountX2, searchRange, entrySelector, rangeShift, pad */
|
||||
8 /* format, length, languages, segCountX2, searchRange, entrySelector,
|
||||
rangeShift, pad */
|
||||
+ segmentCount * 4 /* endCount, startCount, idRange, idRangeOffset */;
|
||||
const size_t finalLength = sizeof(uint16_t) * numOfUint16;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ TEST(GraphemeBreak, rules) {
|
||||
EXPECT_FALSE(IsBreak("'a' | U+0301")); // combining accent
|
||||
// TODO(jsimmons): re-enable this test when ICU has been updated in all
|
||||
// Flutter platforms.
|
||||
//EXPECT_FALSE(IsBreak("'a' | U+200D")); // ZWJ
|
||||
// EXPECT_FALSE(IsBreak("'a' | U+200D")); // ZWJ
|
||||
// Rule GB9a, x SpacingMark
|
||||
EXPECT_FALSE(IsBreak("U+0915 | U+093E")); // KA, AA (spacing mark)
|
||||
// Rule GB9b, Prepend x
|
||||
|
||||
@@ -102,7 +102,7 @@ final List<RegExp> copyrightStatementPatterns = <RegExp>[
|
||||
new RegExp(r'[-_a-zA-Z0-9()]+ function provided freely by .+'), // TODO(ianh): file a bug on analyzer about what happens if you omit this comma
|
||||
new RegExp(r'^.+ optimized code \(C\) COPYRIGHT .+$', caseSensitive: false),
|
||||
new RegExp(r'^\(Royal Institute of Technology, Stockholm, Sweden\)\.$'),
|
||||
new RegExp(r'^https?://[^ ]+$'),
|
||||
new RegExp(r'^\(?https?://[^ ]+$\)?'),
|
||||
|
||||
new RegExp(r'^The Original Code is Mozilla Communicator client code, released$'),
|
||||
new RegExp(r'^March 31, 1998.$'), // mozilla first release date
|
||||
@@ -1034,7 +1034,7 @@ final List<MultipleVersionedLicenseReferencePattern> csReferencesByUrl = <Multip
|
||||
r'^(?:(?:\1\2? *)? *\n)*'
|
||||
r'^\1\2You should have received a copy of the (GNU Lesser) General Public *\n'
|
||||
r'^\1\2License along with this library; if not, write to the Free Software *\n'
|
||||
r'^\1\2Foundation, Inc\., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *\n'
|
||||
r'^\1\2Foundation, Inc\., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +USA *\n'
|
||||
r'^(?:(?:\1\2? *)? *\n)*'
|
||||
r'^\1\2Alternatively, the contents of this file may be used under the terms *\n'
|
||||
r'^\1\2of either the Mozilla Public License Version 1\.1, found at *\n'
|
||||
|
||||
@@ -58,7 +58,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk,
|
||||
.pQueuePriorities = priorities,
|
||||
};
|
||||
|
||||
const char *extensions[] = {
|
||||
const char* extensions[] = {
|
||||
VK_KHR_SWAPCHAIN_EXTENSION_NAME,
|
||||
#if OS_FUCHSIA
|
||||
VK_GOOGLE_EXTERNAL_MEMORY_MAGMA_EXTENSION_NAME,
|
||||
|
||||
@@ -57,7 +57,7 @@ class VulkanHandle {
|
||||
|
||||
void Reset() { DisposeIfNecessary(); }
|
||||
|
||||
private:
|
||||
private:
|
||||
Handle handle_;
|
||||
Disposer disposer_;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ bool VulkanImage::InsertImageMemoryBarrier(
|
||||
nullptr, // buffer_memory_barriers
|
||||
1, // image_memory_barrier_count
|
||||
&image_memory_barrier // image_memory_barriers
|
||||
);
|
||||
);
|
||||
|
||||
if (success) {
|
||||
access_flags_ = dest_access_flags;
|
||||
|
||||
Reference in New Issue
Block a user