forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d00efdd
commit ead8058
Showing
16 changed files
with
108 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "impeller/aiks/paint_pass_delegate.h" | ||
|
||
#include "impeller/entity/contents.h" | ||
|
||
namespace impeller { | ||
|
||
PaintPassDelegate::PaintPassDelegate(Paint paint) : paint_(std::move(paint)) {} | ||
|
||
// |EntityPassDelgate| | ||
PaintPassDelegate::~PaintPassDelegate() = default; | ||
|
||
// |EntityPassDelgate| | ||
bool PaintPassDelegate::CanCollapseIntoParentPass() { | ||
if (paint_.color.IsOpaque()) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
// |EntityPassDelgate| | ||
std::shared_ptr<Contents> PaintPassDelegate::CreateContentsForSubpassTarget( | ||
std::shared_ptr<Texture> target) { | ||
auto contents = std::make_shared<TextureContents>(); | ||
contents->SetTexture(target); | ||
contents->SetSourceRect(IRect::MakeSize(target->GetSize())); | ||
contents->SetOpacity(paint_.color.alpha); | ||
return contents; | ||
} | ||
|
||
} // namespace impeller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#pragma once | ||
|
||
#include "flutter/fml/macros.h" | ||
#include "impeller/aiks/paint.h" | ||
#include "impeller/entity/entity_pass_delegate.h" | ||
|
||
namespace impeller { | ||
|
||
class PaintPassDelegate final : public EntityPassDelegate { | ||
public: | ||
PaintPassDelegate(Paint paint); | ||
|
||
// |EntityPassDelgate| | ||
~PaintPassDelegate() override; | ||
|
||
// |EntityPassDelgate| | ||
bool CanCollapseIntoParentPass() override; | ||
|
||
// |EntityPassDelgate| | ||
std::shared_ptr<Contents> CreateContentsForSubpassTarget( | ||
std::shared_ptr<Texture> target) override; | ||
|
||
private: | ||
const Paint paint_; | ||
|
||
FML_DISALLOW_COPY_AND_ASSIGN(PaintPassDelegate); | ||
}; | ||
|
||
} // namespace impeller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters