forked from flutter/engine
-
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.
Add a no-op platform view layer. (flutter#6505)
This will be used for embedding UIViews on iOS. Landing a no-op layer as a first incremental step to keep PRs small.
- Loading branch information
Showing
7 changed files
with
97 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2018 The Chromium 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 "flutter/flow/layers/platform_view_layer.h" | ||
|
||
namespace flow { | ||
|
||
PlatformViewLayer::PlatformViewLayer() = default; | ||
|
||
PlatformViewLayer::~PlatformViewLayer() = default; | ||
|
||
void PlatformViewLayer::Preroll(PrerollContext* context, | ||
const SkMatrix& matrix) { | ||
set_paint_bounds(SkRect::MakeXYWH(offset_.x(), offset_.y(), size_.width(), | ||
size_.height())); | ||
} | ||
|
||
void PlatformViewLayer::Paint(PaintContext& context) const {} | ||
|
||
} // namespace flow |
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,39 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_FLOW_LAYERS_PLATFORM_VIEW_LAYER_H_ | ||
#define FLUTTER_FLOW_LAYERS_PLATFORM_VIEW_LAYER_H_ | ||
|
||
#include "flutter/flow/layers/layer.h" | ||
#include "third_party/skia/include/core/SkSurface.h" | ||
#include "third_party/skia/include/gpu/GrBackendSurface.h" | ||
#include "third_party/skia/include/gpu/GrContext.h" | ||
#include "third_party/skia/include/gpu/GrTexture.h" | ||
#include "third_party/skia/include/gpu/GrTypes.h" | ||
|
||
namespace flow { | ||
|
||
class PlatformViewLayer : public Layer { | ||
public: | ||
PlatformViewLayer(); | ||
~PlatformViewLayer() override; | ||
|
||
void set_offset(const SkPoint& offset) { offset_ = offset; } | ||
void set_size(const SkSize& size) { size_ = size; } | ||
void set_view_id(int64_t view_id) { view_id_ = view_id; } | ||
|
||
void Preroll(PrerollContext* context, const SkMatrix& matrix) override; | ||
void Paint(PaintContext& context) const override; | ||
|
||
private: | ||
SkPoint offset_; | ||
SkSize size_; | ||
int64_t view_id_; | ||
|
||
FML_DISALLOW_COPY_AND_ASSIGN(PlatformViewLayer); | ||
}; | ||
|
||
} // namespace flow | ||
|
||
#endif // FLUTTER_FLOW_LAYERS_PLATFORM_VIEW_LAYER_H_ |
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