Skip to content

Commit 819b033

Browse files
chinmaygardednfield
authored andcommitted
Cross reference issues and add additional tracing.
1 parent f700873 commit 819b033

File tree

7 files changed

+39
-2
lines changed

7 files changed

+39
-2
lines changed

impeller/display_list/display_list_dispatcher.cc

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "impeller/display_list/display_list_dispatcher.h"
66

7+
#include "flutter/fml/trace_event.h"
78
#include "impeller/geometry/path_builder.h"
89

910
namespace impeller {
@@ -73,11 +74,13 @@ void DisplayListDispatcher::setStrokeJoin(SkPaint::Join join) {
7374

7475
// |flutter::Dispatcher|
7576
void DisplayListDispatcher::setShader(sk_sp<SkShader> shader) {
77+
// Needs https://github.com/flutter/flutter/issues/95434
7678
UNIMPLEMENTED;
7779
}
7880

7981
// |flutter::Dispatcher|
8082
void DisplayListDispatcher::setColorFilter(sk_sp<SkColorFilter> filter) {
83+
// Needs https://github.com/flutter/flutter/issues/95434
8184
UNIMPLEMENTED;
8285
}
8386

@@ -93,16 +96,19 @@ void DisplayListDispatcher::setBlendMode(SkBlendMode mode) {
9396

9497
// |flutter::Dispatcher|
9598
void DisplayListDispatcher::setBlender(sk_sp<SkBlender> blender) {
99+
// Needs https://github.com/flutter/flutter/issues/95434
96100
UNIMPLEMENTED;
97101
}
98102

99103
// |flutter::Dispatcher|
100104
void DisplayListDispatcher::setPathEffect(sk_sp<SkPathEffect> effect) {
105+
// Needs https://github.com/flutter/flutter/issues/95434
101106
UNIMPLEMENTED;
102107
}
103108

104109
// |flutter::Dispatcher|
105110
void DisplayListDispatcher::setMaskFilter(sk_sp<SkMaskFilter> filter) {
111+
// Needs https://github.com/flutter/flutter/issues/95434
106112
UNIMPLEMENTED;
107113
}
108114

@@ -396,6 +402,7 @@ void DisplayListDispatcher::drawPoints(SkCanvas::PointMode mode,
396402
// |flutter::Dispatcher|
397403
void DisplayListDispatcher::drawVertices(const sk_sp<SkVertices> vertices,
398404
SkBlendMode mode) {
405+
// Needs https://github.com/flutter/flutter/issues/95434
399406
UNIMPLEMENTED;
400407
}
401408

@@ -404,6 +411,7 @@ void DisplayListDispatcher::drawImage(const sk_sp<SkImage> image,
404411
const SkPoint point,
405412
const SkSamplingOptions& sampling,
406413
bool render_with_attributes) {
414+
// Needs https://github.com/flutter/flutter/issues/95434
407415
UNIMPLEMENTED;
408416
}
409417

@@ -415,6 +423,7 @@ void DisplayListDispatcher::drawImageRect(
415423
const SkSamplingOptions& sampling,
416424
bool render_with_attributes,
417425
SkCanvas::SrcRectConstraint constraint) {
426+
// Needs https://github.com/flutter/flutter/issues/95434
418427
UNIMPLEMENTED;
419428
}
420429

@@ -424,6 +433,7 @@ void DisplayListDispatcher::drawImageNine(const sk_sp<SkImage> image,
424433
const SkRect& dst,
425434
SkFilterMode filter,
426435
bool render_with_attributes) {
436+
// Needs https://github.com/flutter/flutter/issues/95434
427437
UNIMPLEMENTED;
428438
}
429439

@@ -433,6 +443,7 @@ void DisplayListDispatcher::drawImageLattice(const sk_sp<SkImage> image,
433443
const SkRect& dst,
434444
SkFilterMode filter,
435445
bool render_with_attributes) {
446+
// Needs https://github.com/flutter/flutter/issues/95434
436447
UNIMPLEMENTED;
437448
}
438449

@@ -446,13 +457,15 @@ void DisplayListDispatcher::drawAtlas(const sk_sp<SkImage> atlas,
446457
const SkSamplingOptions& sampling,
447458
const SkRect* cull_rect,
448459
bool render_with_attributes) {
460+
// Needs https://github.com/flutter/flutter/issues/95434
449461
UNIMPLEMENTED;
450462
}
451463

452464
// |flutter::Dispatcher|
453465
void DisplayListDispatcher::drawPicture(const sk_sp<SkPicture> picture,
454466
const SkMatrix* matrix,
455467
bool render_with_attributes) {
468+
// Needs https://github.com/flutter/flutter/issues/95434
456469
UNIMPLEMENTED;
457470
}
458471

@@ -466,7 +479,17 @@ void DisplayListDispatcher::drawDisplayList(
466479
void DisplayListDispatcher::drawTextBlob(const sk_sp<SkTextBlob> blob,
467480
SkScalar x,
468481
SkScalar y) {
469-
UNIMPLEMENTED;
482+
if (!blob) {
483+
return;
484+
}
485+
486+
auto bounds = blob->bounds();
487+
bounds.fLeft += x;
488+
bounds.fTop += y;
489+
490+
impeller::Paint paint;
491+
paint.color = impeller::Color::Random().WithAlpha(0.2);
492+
canvas_.DrawRect(ToRect(bounds), paint);
470493
}
471494

472495
// |flutter::Dispatcher|
@@ -479,6 +502,7 @@ void DisplayListDispatcher::drawShadow(const SkPath& path,
479502
}
480503

481504
Picture DisplayListDispatcher::EndRecordingAsPicture() {
505+
TRACE_EVENT0("impeller", "DisplayListDispatcher::EndRecordingAsPicture");
482506
return canvas_.EndRecordingAsPicture();
483507
}
484508

impeller/entity/entity_pass.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "impeller/entity/entity_pass.h"
66

7+
#include "flutter/fml/trace_event.h"
78
#include "impeller/entity/content_context.h"
89
#include "impeller/geometry/path_builder.h"
910
#include "impeller/renderer/command_buffer.h"
@@ -99,6 +100,8 @@ EntityPass* EntityPass::AddSubpass(std::unique_ptr<EntityPass> pass) {
99100

100101
bool EntityPass::Render(ContentContext& renderer,
101102
RenderPass& parent_pass) const {
103+
TRACE_EVENT0("impeller", "EntityPass::Render");
104+
102105
for (const auto& entity : entities_) {
103106
if (!entity.Render(renderer, parent_pass)) {
104107
return false;

impeller/renderer/backend/metal/render_pass_mtl.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "flutter/fml/closure.h"
88
#include "flutter/fml/logging.h"
9+
#include "flutter/fml/trace_event.h"
910
#include "impeller/base/base.h"
1011
#include "impeller/renderer/backend/metal/device_buffer_mtl.h"
1112
#include "impeller/renderer/backend/metal/formats_mtl.h"
@@ -156,6 +157,7 @@ static bool ConfigureStencilAttachment(
156157
}
157158

158159
bool RenderPassMTL::EncodeCommands(Allocator& transients_allocator) const {
160+
TRACE_EVENT0("impeller", "RenderPassMTL::EncodeCommands");
159161
if (!IsValid()) {
160162
return false;
161163
}

impeller/renderer/backend/metal/surface_mtl.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
std::unique_ptr<Surface> SurfaceMTL::WrapCurrentMetalLayerDrawable(
1616
std::shared_ptr<Context> context,
1717
CAMetalLayer* layer) {
18-
TRACE_EVENT0("flutter", __FUNCTION__);
18+
TRACE_EVENT0("impeller", "SurfaceMTL::WrapCurrentMetalLayerDrawable");
1919

2020
if (context == nullptr || !context->IsValid() || layer == nil) {
2121
return nullptr;

impeller/renderer/renderer.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <algorithm>
88

99
#include "flutter/fml/logging.h"
10+
#include "flutter/fml/trace_event.h"
1011
#include "impeller/base/validation.h"
1112
#include "impeller/renderer/command_buffer.h"
1213
#include "impeller/renderer/surface.h"
@@ -33,6 +34,7 @@ bool Renderer::IsValid() const {
3334

3435
bool Renderer::Render(std::unique_ptr<Surface> surface,
3536
RenderCallback render_callback) const {
37+
TRACE_EVENT0("impeller", "Renderer::Render");
3638
if (!IsValid()) {
3739
return false;
3840
}

impeller/renderer/tessellator.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "impeller/renderer/tessellator.h"
66

7+
#include "flutter/fml/trace_event.h"
78
#include "third_party/libtess2/Include/tesselator.h"
89

910
namespace impeller {
@@ -36,6 +37,7 @@ static void DestroyTessellator(TESStesselator* tessellator) {
3637

3738
bool Tessellator::Tessellate(const std::vector<Point>& contours,
3839
VertexCallback callback) const {
40+
TRACE_EVENT0("impeller", "Tessellator::Tessellate");
3941
if (!callback) {
4042
return false;
4143
}

impeller/renderer/texture_descriptor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
namespace impeller {
1414

15+
//------------------------------------------------------------------------------
16+
/// @brief A lightweight object that describes the attributes of a texture
17+
/// that can then used used an allocator to create that texture.
18+
///
1519
struct TextureDescriptor {
1620
TextureType type = TextureType::kTexture2D;
1721
PixelFormat format = PixelFormat::kUnknown;

0 commit comments

Comments
 (0)