[TreesInViz] Add reason to represent a tile with no contents.
Introduces a new Reason enum inside NoContents to track why a tile has no content. Also adds a corresponding kTileDeleted value in the MissingTileReason mojom enum to represent tiles that were explicitly deleted by the client. This enables the Viz compositor to distinguish between different NoContents cases, such as tiles that are missing due to deletion, out-of-memory, etc. This is a required to improving tile lifecycle handling in Viz as well as to allow for checkerboard tiles which were OOMed. Future CLs will add renderer-side and Viz-side logic to make use of this information. Bug: 417965009 Change-Id: Iccac26d42a6d0c3088f6e67357dc8d79e0399724 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6553564 Reviewed-by: Victor Miura <vmiura@chromium.org> Commit-Queue: vikas soni <vikassoni@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Auto-Submit: vikas soni <vikassoni@chromium.org> Cr-Commit-Position: refs/heads/main@{#1461084}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
58b747d695
commit
8222692bb8
cc
components/viz/service/layers
services/viz/public/mojom/compositing
@ -493,6 +493,7 @@ cc_component("cc") {
|
||||
"//services/metrics/public/cpp:ukm_builders",
|
||||
"//services/metrics/public/mojom",
|
||||
"//services/tracing/public/cpp:cpp",
|
||||
"//services/viz/public/mojom",
|
||||
"//skia:skcms",
|
||||
"//third_party/blink/public/common/tokens:tokens_headers",
|
||||
"//ui/base:features",
|
||||
|
1
cc/DEPS
1
cc/DEPS
@ -35,6 +35,7 @@ include_rules = [
|
||||
"+skia/ext",
|
||||
"+services/metrics/public/cpp",
|
||||
"+services/tracing/public/cpp",
|
||||
"+services/viz/public/mojom/compositing/tiling.mojom.h",
|
||||
"+third_party/blink/public/common/tokens/tokens.h",
|
||||
"+third_party/dawn/include",
|
||||
"+third_party/khronos/GLES2/gl2.h",
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "cc/tiles/tiling_coverage_iterator.h"
|
||||
#include "components/viz/common/resources/shared_image_format.h"
|
||||
#include "components/viz/common/resources/transferable_resource.h"
|
||||
#include "services/viz/public/mojom/compositing/tiling.mojom.h"
|
||||
#include "ui/gfx/geometry/axis_transform2d.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
@ -31,7 +32,13 @@ namespace cc {
|
||||
// layer down to Viz, and this layer uses that information to draw tile quads.
|
||||
class CC_EXPORT TileDisplayLayerImpl : public LayerImpl {
|
||||
public:
|
||||
struct NoContents {};
|
||||
struct NoContents {
|
||||
viz::mojom::MissingTileReason reason =
|
||||
viz::mojom::MissingTileReason::kResourceNotReady;
|
||||
|
||||
NoContents() = default;
|
||||
explicit NoContents(viz::mojom::MissingTileReason r) : reason(r) {}
|
||||
};
|
||||
|
||||
struct CC_EXPORT TileResource {
|
||||
TileResource(const viz::TransferableResource& resource,
|
||||
|
@ -744,7 +744,7 @@ DeserializeTileContents(mojom::TileContents& wire) {
|
||||
switch (wire.which()) {
|
||||
case mojom::TileContents::Tag::kMissingReason:
|
||||
return cc::TileDisplayLayerImpl::TileContents(
|
||||
cc::TileDisplayLayerImpl::NoContents());
|
||||
cc::TileDisplayLayerImpl::NoContents(wire.get_missing_reason()));
|
||||
|
||||
case mojom::TileContents::Tag::kResource:
|
||||
return DeserializeTileResource(*wire.get_resource());
|
||||
|
@ -17,11 +17,12 @@ struct TileResource {
|
||||
bool is_checkered;
|
||||
};
|
||||
|
||||
// For tiles that are missing or otherwise not ready to draw, this is the
|
||||
// reason why.
|
||||
// For tiles that are missing due to OOM, deleted or otherwise not ready to
|
||||
// draw, this is the reason why.
|
||||
enum MissingTileReason {
|
||||
kOutOfMemory,
|
||||
kResourceNotReady,
|
||||
kTileDeleted,
|
||||
};
|
||||
|
||||
// Describes the visual contents of a tile.
|
||||
|
Reference in New Issue
Block a user