Skip to content

Commit 57a0728

Browse files
chinmaygardednfield
authored andcommitted
Rework the confusingly named renderer subsystem instances.
1 parent a404064 commit 57a0728

19 files changed

+72
-63
lines changed

impeller/BUILD.gn

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
# found in the LICENSE file.
44

55
config("impeller_public_config") {
6-
include_dirs = [ ".." ]
6+
include_dirs = [
7+
"..",
8+
".",
9+
]
710
}
811

912
is_host = is_mac || is_linux || is_win

impeller/aiks/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import("../tools/impeller.gni")
66

77
impeller_component("aiks") {
88
sources = [
9-
"aiks_renderer.cc",
10-
"aiks_renderer.h",
9+
"aiks_context.cc",
10+
"aiks_context.h",
1111
"canvas.cc",
1212
"canvas.h",
1313
"image.cc",

impeller/aiks/aiks_renderer.cc renamed to impeller/aiks/aiks_context.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#include "impeller/aiks/aiks_renderer.h"
5+
#include "impeller/aiks/aiks_context.h"
66

77
#include "impeller/aiks/picture.h"
88

99
namespace impeller {
1010

11-
AiksRenderer::AiksRenderer(std::shared_ptr<Context> context)
11+
AiksContext::AiksContext(std::shared_ptr<Context> context)
1212
: context_(std::move(context)) {
1313
if (!context_ || !context_->IsValid()) {
1414
return;
1515
}
1616

17-
content_renderer_ = std::make_unique<ContentRenderer>(context_);
18-
if (!content_renderer_->IsValid()) {
17+
content_context_ = std::make_unique<ContentContext>(context_);
18+
if (!content_context_->IsValid()) {
1919
return;
2020
}
2121

2222
is_valid_ = true;
2323
}
2424

25-
AiksRenderer::~AiksRenderer() = default;
25+
AiksContext::~AiksContext() = default;
2626

27-
bool AiksRenderer::IsValid() const {
27+
bool AiksContext::IsValid() const {
2828
return is_valid_;
2929
}
3030

31-
bool AiksRenderer::Render(const Picture& picture, RenderPass& parent_pass) {
31+
bool AiksContext::Render(const Picture& picture, RenderPass& parent_pass) {
3232
if (!IsValid()) {
3333
return false;
3434
}
3535

3636
if (picture.pass) {
37-
return picture.pass->Render(*content_renderer_, parent_pass);
37+
return picture.pass->Render(*content_context_, parent_pass);
3838
}
3939

4040
return true;

impeller/aiks/aiks_renderer.h renamed to impeller/aiks/aiks_context.h

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

99
#include "flutter/fml/macros.h"
10-
#include "impeller/entity/content_renderer.h"
10+
#include "impeller/entity/content_context.h"
1111
#include "impeller/renderer/context.h"
1212

1313
namespace impeller {
1414

1515
struct Picture;
1616
class RenderPass;
1717

18-
class AiksRenderer {
18+
class AiksContext {
1919
public:
20-
AiksRenderer(std::shared_ptr<Context> context);
20+
AiksContext(std::shared_ptr<Context> context);
2121

22-
~AiksRenderer();
22+
~AiksContext();
2323

2424
bool IsValid() const;
2525

2626
bool Render(const Picture& picture, RenderPass& parent_pass);
2727

2828
private:
2929
std::shared_ptr<Context> context_;
30-
std::unique_ptr<ContentRenderer> content_renderer_;
30+
std::unique_ptr<ContentContext> content_context_;
3131
bool is_valid_ = false;
3232

33-
FML_DISALLOW_COPY_AND_ASSIGN(AiksRenderer);
33+
FML_DISALLOW_COPY_AND_ASSIGN(AiksContext);
3434
};
3535

3636
} // namespace impeller

impeller/aiks/aiks_playground.cc

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

55
#include "impeller/aiks/aiks_playground.h"
66

7-
#include "impeller/aiks/aiks_renderer.h"
7+
#include "impeller/aiks/aiks_context.h"
88

99
namespace impeller {
1010

@@ -13,7 +13,7 @@ AiksPlayground::AiksPlayground() = default;
1313
AiksPlayground::~AiksPlayground() = default;
1414

1515
bool AiksPlayground::OpenPlaygroundHere(const Picture& picture) {
16-
AiksRenderer renderer(GetContext());
16+
AiksContext renderer(GetContext());
1717

1818
if (!renderer.IsValid()) {
1919
return false;

impeller/display_list/display_list_dispatcher.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#pragma once
66

77
#include "flutter/display_list/display_list.h"
8+
#include "flutter/display_list/display_list_dispatcher.h"
89
#include "flutter/fml/macros.h"
910
#include "impeller/aiks/canvas.h"
1011
#include "impeller/aiks/paint.h"

impeller/entity/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ impeller_shaders("entity_shaders") {
2121

2222
impeller_component("entity") {
2323
sources = [
24-
"content_renderer.cc",
25-
"content_renderer.h",
24+
"content_context.cc",
25+
"content_context.h",
2626
"contents.cc",
2727
"contents.h",
2828
"entity.cc",

impeller/entity/content_renderer.cc renamed to impeller/entity/content_context.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#include "impeller/entity/content_renderer.h"
5+
#include "impeller/entity/content_context.h"
66

77
namespace impeller {
88

9-
ContentRenderer::ContentRenderer(std::shared_ptr<Context> context)
9+
ContentContext::ContentContext(std::shared_ptr<Context> context)
1010
: context_(std::move(context)) {
1111
if (!context_ || !context_->IsValid()) {
1212
return;
@@ -46,13 +46,13 @@ ContentRenderer::ContentRenderer(std::shared_ptr<Context> context)
4646
is_valid_ = true;
4747
}
4848

49-
ContentRenderer::~ContentRenderer() = default;
49+
ContentContext::~ContentContext() = default;
5050

51-
bool ContentRenderer::IsValid() const {
51+
bool ContentContext::IsValid() const {
5252
return is_valid_;
5353
}
5454

55-
std::shared_ptr<Context> ContentRenderer::GetContext() const {
55+
std::shared_ptr<Context> ContentContext::GetContext() const {
5656
return context_;
5757
}
5858

impeller/entity/content_renderer.h renamed to impeller/entity/content_context.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using SolidStrokePipeline =
3333
// to redirect writing to the stencil instead of color attachments.
3434
using ClipPipeline = PipelineT<SolidFillVertexShader, SolidFillFragmentShader>;
3535

36-
class ContentRenderer {
36+
class ContentContext {
3737
public:
3838
struct Options {
3939
SampleCount sample_count = SampleCount::kCount1;
@@ -51,9 +51,9 @@ class ContentRenderer {
5151
};
5252
};
5353

54-
ContentRenderer(std::shared_ptr<Context> context);
54+
ContentContext(std::shared_ptr<Context> context);
5555

56-
~ContentRenderer();
56+
~ContentContext();
5757

5858
bool IsValid() const;
5959

@@ -128,7 +128,7 @@ class ContentRenderer {
128128

129129
bool is_valid_ = false;
130130

131-
FML_DISALLOW_COPY_AND_ASSIGN(ContentRenderer);
131+
FML_DISALLOW_COPY_AND_ASSIGN(ContentContext);
132132
};
133133

134134
} // namespace impeller

impeller/entity/contents.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <memory>
88

99
#include "flutter/fml/logging.h"
10-
#include "impeller/entity/content_renderer.h"
10+
#include "impeller/entity/content_context.h"
1111
#include "impeller/entity/entity.h"
1212
#include "impeller/geometry/path_builder.h"
1313
#include "impeller/geometry/vector.h"
@@ -19,8 +19,8 @@
1919

2020
namespace impeller {
2121

22-
static ContentRenderer::Options OptionsFromPass(const RenderPass& pass) {
23-
ContentRenderer::Options opts;
22+
static ContentContext::Options OptionsFromPass(const RenderPass& pass) {
23+
ContentContext::Options opts;
2424
opts.sample_count = pass.GetRenderTarget().GetSampleCount();
2525
return opts;
2626
}
@@ -60,7 +60,7 @@ const std::vector<Color>& LinearGradientContents::GetColors() const {
6060
return colors_;
6161
}
6262

63-
bool LinearGradientContents::Render(const ContentRenderer& renderer,
63+
bool LinearGradientContents::Render(const ContentContext& renderer,
6464
const Entity& entity,
6565
RenderPass& pass) const {
6666
using VS = GradientFillPipeline::VertexShader;
@@ -137,7 +137,7 @@ static VertexBuffer CreateSolidFillVertices(const Path& path,
137137
return vtx_builder.CreateVertexBuffer(buffer);
138138
}
139139

140-
bool SolidColorContents::Render(const ContentRenderer& renderer,
140+
bool SolidColorContents::Render(const ContentContext& renderer,
141141
const Entity& entity,
142142
RenderPass& pass) const {
143143
if (color_.IsTransparent()) {
@@ -194,7 +194,7 @@ void TextureContents::SetOpacity(Scalar opacity) {
194194
opacity_ = opacity;
195195
}
196196

197-
bool TextureContents::Render(const ContentRenderer& renderer,
197+
bool TextureContents::Render(const ContentContext& renderer,
198198
const Entity& entity,
199199
RenderPass& pass) const {
200200
if (texture_ == nullptr) {
@@ -328,7 +328,7 @@ static VertexBuffer CreateSolidStrokeVertices(const Path& path,
328328
return vtx_builder.CreateVertexBuffer(buffer);
329329
}
330330

331-
bool SolidStrokeContents::Render(const ContentRenderer& renderer,
331+
bool SolidStrokeContents::Render(const ContentContext& renderer,
332332
const Entity& entity,
333333
RenderPass& pass) const {
334334
if (color_.IsTransparent() || stroke_size_ <= 0.0) {
@@ -377,7 +377,7 @@ ClipContents::ClipContents() = default;
377377

378378
ClipContents::~ClipContents() = default;
379379

380-
bool ClipContents::Render(const ContentRenderer& renderer,
380+
bool ClipContents::Render(const ContentContext& renderer,
381381
const Entity& entity,
382382
RenderPass& pass) const {
383383
using VS = ClipPipeline::VertexShader;

impeller/entity/contents.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace impeller {
1717

18-
class ContentRenderer;
18+
class ContentContext;
1919
class Entity;
2020
class Surface;
2121
class RenderPass;
@@ -26,7 +26,7 @@ class Contents {
2626

2727
virtual ~Contents();
2828

29-
virtual bool Render(const ContentRenderer& renderer,
29+
virtual bool Render(const ContentContext& renderer,
3030
const Entity& entity,
3131
RenderPass& pass) const = 0;
3232

@@ -41,7 +41,7 @@ class LinearGradientContents final : public Contents {
4141
~LinearGradientContents() override;
4242

4343
// |Contents|
44-
bool Render(const ContentRenderer& renderer,
44+
bool Render(const ContentContext& renderer,
4545
const Entity& entity,
4646
RenderPass& pass) const override;
4747

@@ -72,7 +72,7 @@ class SolidColorContents final : public Contents {
7272
const Color& GetColor() const;
7373

7474
// |Contents|
75-
bool Render(const ContentRenderer& renderer,
75+
bool Render(const ContentContext& renderer,
7676
const Entity& entity,
7777
RenderPass& pass) const override;
7878

@@ -99,7 +99,7 @@ class TextureContents final : public Contents {
9999
const IRect& GetSourceRect() const;
100100

101101
// |Contents|
102-
bool Render(const ContentRenderer& renderer,
102+
bool Render(const ContentContext& renderer,
103103
const Entity& entity,
104104
RenderPass& pass) const override;
105105

@@ -126,7 +126,7 @@ class SolidStrokeContents final : public Contents {
126126
Scalar GetStrokeSize() const;
127127

128128
// |Contents|
129-
bool Render(const ContentRenderer& renderer,
129+
bool Render(const ContentContext& renderer,
130130
const Entity& entity,
131131
RenderPass& pass) const override;
132132

@@ -144,7 +144,7 @@ class ClipContents final : public Contents {
144144
~ClipContents();
145145

146146
// |Contents|
147-
bool Render(const ContentRenderer& renderer,
147+
bool Render(const ContentContext& renderer,
148148
const Entity& entity,
149149
RenderPass& pass) const override;
150150

impeller/entity/entity.cc

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

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

7-
#include "impeller/entity/content_renderer.h"
7+
#include "impeller/entity/content_context.h"
88
#include "impeller/renderer/render_pass.h"
99

1010
namespace impeller {
@@ -65,7 +65,7 @@ void Entity::IncrementStencilDepth(uint32_t increment) {
6565
stencil_depth_ += increment;
6666
}
6767

68-
bool Entity::Render(ContentRenderer& renderer, RenderPass& parent_pass) const {
68+
bool Entity::Render(ContentContext& renderer, RenderPass& parent_pass) const {
6969
if (!contents_) {
7070
return true;
7171
}

impeller/entity/entity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Entity {
4646

4747
uint32_t GetStencilDepth() const;
4848

49-
bool Render(ContentRenderer& renderer, RenderPass& parent_pass) const;
49+
bool Render(ContentContext& renderer, RenderPass& parent_pass) const;
5050

5151
private:
5252
Matrix transformation_;

impeller/entity/entity_pass.cc

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

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

7-
#include "impeller/entity/content_renderer.h"
7+
#include "impeller/entity/content_context.h"
88
#include "impeller/geometry/path_builder.h"
99
#include "impeller/renderer/command_buffer.h"
1010
#include "impeller/renderer/render_pass.h"
@@ -97,7 +97,7 @@ EntityPass* EntityPass::AddSubpass(std::unique_ptr<EntityPass> pass) {
9797
return subpasses_.emplace_back(std::move(pass)).get();
9898
}
9999

100-
bool EntityPass::Render(ContentRenderer& renderer,
100+
bool EntityPass::Render(ContentContext& renderer,
101101
RenderPass& parent_pass) const {
102102
for (const auto& entity : entities_) {
103103
if (!entity.Render(renderer, parent_pass)) {

impeller/entity/entity_pass.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace impeller {
1818

19-
class ContentRenderer;
19+
class ContentContext;
2020

2121
class EntityPass {
2222
public:
@@ -45,7 +45,7 @@ class EntityPass {
4545

4646
EntityPass* GetSuperpass() const;
4747

48-
bool Render(ContentRenderer& renderer, RenderPass& parent_pass) const;
48+
bool Render(ContentContext& renderer, RenderPass& parent_pass) const;
4949

5050
void IterateAllEntities(std::function<bool(Entity&)> iterator);
5151

0 commit comments

Comments
 (0)