LAST_VIEWPORT_LAYER_TYPE = OUTER_VIEWPORT_SCROLL,
};
+#if BUILDFLAG(IS_EFL)
+enum LayerType {
+ LAYER_TYPE_NORMAL = 1,
+ LAYER_TYPE_TEXTURE = 1 << 1,
+ LAYER_TYPE_VIDEO = 1 << 2
+};
+
+typedef unsigned LayerTypeMask;
+#endif
+
class CC_EXPORT LayerImpl {
public:
static std::unique_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
ElementListType GetElementTypeForAnimation() const;
+#if BUILDFLAG(IS_EFL)
+ virtual LayerType GetLayerType() const { return LAYER_TYPE_NORMAL; }
+#endif
+
void set_needs_show_scrollbars(bool yes) { needs_show_scrollbars_ = yes; }
bool needs_show_scrollbars() { return needs_show_scrollbars_; }
scoped_refptr<CrossThreadSharedBitmap> bitmap);
void UnregisterSharedBitmapId(viz::SharedBitmapId id);
+#if BUILDFLAG(IS_EFL)
+ LayerType GetLayerType() const override { return LAYER_TYPE_TEXTURE; }
+#endif
+
private:
TextureLayerImpl(LayerTreeImpl* tree_impl, int id);
return video_transform_;
}
+#if BUILDFLAG(IS_EFL)
+ LayerType GetLayerType() const override { return LAYER_TYPE_VIDEO; }
+#endif
+
private:
VideoLayerImpl(
LayerTreeImpl* tree_impl,
}
metadata.capture_bounds = CollectRegionCaptureBounds();
+#if BUILDFLAG(IS_EFL)
+ metadata.can_skip_flush = CanSkipFlush();
+#endif
return metadata;
}
return SubmitInfo{submit_time, std::move(events_metrics)};
}
+#if BUILDFLAG(IS_EFL)
+bool LayerTreeHostImpl::CanSkipFlush() const {
+ if (active_tree_->HasLayer(LAYER_TYPE_TEXTURE | LAYER_TYPE_VIDEO))
+ return true;
+ return false;
+}
+#endif
+
viz::CompositorFrame LayerTreeHostImpl::GenerateCompositorFrame(
FrameData* frame) {
TRACE_EVENT(
void RequestBeginFrameForAnimatedImages() override;
void RequestInvalidationForAnimatedImages() override;
+#if BUILDFLAG(IS_EFL)
+ bool CanSkipFlush() const;
+#endif
+
base::WeakPtr<LayerTreeHostImpl> AsWeakPtr();
void set_resourceless_software_draw_for_testing() {
host_impl_->DidAnimateScrollOffset();
}
+#if BUILDFLAG(IS_EFL)
+bool LayerTreeImpl::HasLayer(LayerTypeMask layer_type_mask) const {
+ for (auto& layer : layer_list_) {
+ if (layer_type_mask & layer->GetLayerType())
+ return true;
+ }
+ return false;
+}
+#endif
+
bool LayerTreeImpl::use_gpu_rasterization() const {
return host_impl_->use_gpu_rasterization();
}
std::unique_ptr<ScrollbarAnimationController>
CreateScrollbarAnimationController(ElementId scroll_element_id,
float initial_opacity);
+#if BUILDFLAG(IS_EFL)
+ bool HasLayer(LayerTypeMask) const;
+#endif
void DidAnimateScrollOffset();
bool use_gpu_rasterization() const;
bool create_low_res_tiling() const;
scrollable_viewport_size(other.scrollable_viewport_size),
content_color_usage(other.content_color_usage),
may_contain_video(other.may_contain_video),
+#if BUILDFLAG(IS_EFL)
+ can_skip_flush(other.can_skip_flush),
+#endif
is_resourceless_software_draw_with_scroll_or_animation(
other.is_resourceless_software_draw_with_scroll_or_animation),
is_handling_interaction(other.is_handling_interaction),
bool may_contain_video = false;
+#if BUILDFLAG(IS_EFL)
+ bool can_skip_flush = false;
+#endif
+
bool may_throttle_if_undrawn_frames = true;
// WebView makes quality decisions for rastering resourceless software frames
// root render pass |output_rect| (display size) on the root surface.
bool page_fullscreen_mode = false;
+#if BUILDFLAG(IS_EFL)
+ bool can_skip_flush = false;
+#endif
+
// A list of surface damage rects in the current frame, used for overlays.
SurfaceDamageRectList surface_damage_rect_list_;
std::vector<ui::LatencyInfo> latency_info;
int64_t seq = -1;
bool top_controls_visible_height_changed = false;
+
+#if BUILDFLAG(IS_EFL)
+ bool can_skip_flush = false;
+#endif
+
#if BUILDFLAG(IS_APPLE)
gfx::CALayerResult ca_layer_error_code = gfx::kCALayerSuccess;
#endif
data->set_display_trace_id(swap_trace_id);
});
+
+#if BUILDFLAG(IS_EFL)
+ swap_frame_data.can_skip_flush = frame.can_skip_flush;
+#endif
+
#if BUILDFLAG(IS_APPLE)
swap_frame_data.ca_layer_error_code =
overlay_processor_->GetCALayerErrorCode();
std::vector<ui::LatencyInfo> latency_info;
absl::optional<int64_t> choreographer_vsync_id;
bool top_controls_visible_height_changed = false;
+#if BUILDFLAG(IS_EFL)
+ bool can_skip_flush = false;
+#endif
// FrameData for GLSurface.
gfx::FrameData data;
// Metadata containing information to draw a delegated ink trail using
output_frame.latency_info = std::move(swap_frame_data.latency_info);
output_frame.top_controls_visible_height_changed =
swap_frame_data.top_controls_visible_height_changed;
+#if BUILDFLAG(IS_EFL)
+ output_frame.can_skip_flush = swap_frame_data.can_skip_flush;
+#endif
output_frame.choreographer_vsync_id = swap_frame_data.choreographer_vsync_id;
output_frame.size = viewport_size_for_swap_buffers();
output_frame.data.seq = swap_frame_data.seq;
base::flat_set<SurfaceId> undrawn_surfaces;
bool frame_sinks_changed = false;
bool page_fullscreen_mode = false;
+#if BUILDFLAG(IS_EFL)
+ bool can_skip_flush = false;
+#endif
gfx::ContentColorUsage content_color_usage = gfx::ContentColorUsage::kSRGB;
};
surface->OnWillBeDrawn();
const CompositorFrame& frame = surface->GetActiveOrInterpolatedFrame();
+
+#if BUILDFLAG(IS_EFL)
+ if (frame.metadata.can_skip_flush)
+ result.can_skip_flush = true;
+#endif
+
for (const SurfaceRange& surface_range : frame.metadata.referenced_surfaces) {
damage_ranges_[surface_range.end().frame_sink_id()].push_back(
surface_range);
frame.has_copy_requests = has_copy_requests_ && take_copy_requests_;
frame.content_color_usage = prewalk_result.content_color_usage;
frame.page_fullscreen_mode = prewalk_result.page_fullscreen_mode;
+#if BUILDFLAG(IS_EFL)
+ frame.can_skip_flush = prewalk_result.can_skip_flush;
+#endif
base::ElapsedTimer copy_timer;
CopyUndrawnSurfaces(&prewalk_result);
DCHECK(backend_texture_.isValid() || graphite_texture_.isValid());
StartSwapBuffers(std::move(feedback));
-#if BUILDFLAG(IS_TIZEN)
- if (IsMobileProfile()) {
+#if BUILDFLAG(IS_EFL)
+ if (!frame.can_skip_flush) {
gr_context_->flushAndSubmit(GrSyncCpu::kYes);
}
#endif
return false;
out->may_contain_video = data.may_contain_video();
+#if BUILDFLAG(IS_EFL)
+ out->can_skip_flush = data.can_skip_flush();
+#endif
out->may_throttle_if_undrawn_frames = data.may_throttle_if_undrawn_frames();
out->has_shared_element_resources = data.has_shared_element_resources();
out->is_resourceless_software_draw_with_scroll_or_animation =
return metadata.may_contain_video;
}
+#if BUILDFLAG(IS_EFL)
+ static bool can_skip_flush(const viz::CompositorFrameMetadata& metadata) {
+ return metadata.can_skip_flush;
+ }
+#endif
+
static bool may_throttle_if_undrawn_frames(
const viz::CompositorFrameMetadata& metadata) {
return metadata.may_throttle_if_undrawn_frames;
if (tizen_video_hole) {
enabled_features += [ "tizen_video_hole" ]
}
+
+ if (use_efl) {
+ enabled_features += [ "is_efl" ]
+ }
}
# The enum that SharedImageFormat uses internally to denote singleplanar
gfx.mojom.SizeF scrollable_viewport_size;
gfx.mojom.ContentColorUsage content_color_usage;
bool may_contain_video;
+
+ [EnableIf=is_efl]
+ bool can_skip_flush;
+
bool may_throttle_if_undrawn_frames;
bool is_resourceless_software_draw_with_scroll_or_animation;
bool is_handling_interaction;