Commit e8474c58 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Remove ForeignLayerDisplayItem::GetLayerAsJSONClient()

It has not been used since we separated GraphicsLayerDisplayItem
from ForeignLayerDisplayItem.

Change-Id: I0fe7467d09364c474252d433d1c5e24ca3360550
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2250640Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780037}
parent 1e5a4bf0
...@@ -125,7 +125,6 @@ std::unique_ptr<JSONObject> PaintArtifactCompositor::GetLayersAsJSON( ...@@ -125,7 +125,6 @@ std::unique_ptr<JSONObject> PaintArtifactCompositor::GetLayersAsJSON(
const auto& foreign_layer_display_item = const auto& foreign_layer_display_item =
static_cast<const ForeignLayerDisplayItem&>(display_item); static_cast<const ForeignLayerDisplayItem&>(display_item);
layer = foreign_layer_display_item.GetLayer(); layer = foreign_layer_display_item.GetLayer();
json_client = foreign_layer_display_item.GetLayerAsJSONClient();
} }
// Need to retrieve the transform from |pending_layers_| so that // Need to retrieve the transform from |pending_layers_| so that
// any decomposition is not double-reported via |layer|'s // any decomposition is not double-reported via |layer|'s
......
...@@ -54,14 +54,12 @@ ForeignLayerDisplayItem::ForeignLayerDisplayItem( ...@@ -54,14 +54,12 @@ ForeignLayerDisplayItem::ForeignLayerDisplayItem(
const DisplayItemClient& client, const DisplayItemClient& client,
Type type, Type type,
scoped_refptr<cc::Layer> layer, scoped_refptr<cc::Layer> layer,
const FloatPoint& offset, const FloatPoint& offset)
const LayerAsJSONClient* json_client)
: DisplayItem( : DisplayItem(
*new ForeignLayerDisplayItemClient(client, std::move(layer), offset), *new ForeignLayerDisplayItemClient(client, std::move(layer), offset),
type, type,
sizeof(*this)), sizeof(*this)),
offset_(offset), offset_(offset) {
json_client_(json_client) {
DCHECK(IsForeignLayerType(type)); DCHECK(IsForeignLayerType(type));
DCHECK(!IsCacheable()); DCHECK(!IsCacheable());
} }
...@@ -74,10 +72,6 @@ cc::Layer* ForeignLayerDisplayItem::GetLayer() const { ...@@ -74,10 +72,6 @@ cc::Layer* ForeignLayerDisplayItem::GetLayer() const {
return static_cast<const ForeignLayerDisplayItemClient&>(Client()).GetLayer(); return static_cast<const ForeignLayerDisplayItemClient&>(Client()).GetLayer();
} }
const LayerAsJSONClient* ForeignLayerDisplayItem::GetLayerAsJSONClient() const {
return json_client_;
}
bool ForeignLayerDisplayItem::Equals(const DisplayItem& other) const { bool ForeignLayerDisplayItem::Equals(const DisplayItem& other) const {
return GetType() == other.GetType() && return GetType() == other.GetType() &&
GetLayer() == GetLayer() ==
...@@ -93,13 +87,12 @@ void ForeignLayerDisplayItem::PropertiesAsJSON(JSONObject& json) const { ...@@ -93,13 +87,12 @@ void ForeignLayerDisplayItem::PropertiesAsJSON(JSONObject& json) const {
} }
#endif #endif
static void RecordForeignLayerInternal(GraphicsContext& context, void RecordForeignLayer(GraphicsContext& context,
const DisplayItemClient& client, const DisplayItemClient& client,
DisplayItem::Type type, DisplayItem::Type type,
scoped_refptr<cc::Layer> layer, scoped_refptr<cc::Layer> layer,
const FloatPoint& offset, const FloatPoint& offset,
const LayerAsJSONClient* json_client, const PropertyTreeState* properties) {
const PropertyTreeState* properties) {
PaintController& paint_controller = context.GetPaintController(); PaintController& paint_controller = context.GetPaintController();
// This is like ScopedPaintChunkProperties but uses null id because foreign // This is like ScopedPaintChunkProperties but uses null id because foreign
// layer chunk doesn't need an id nor a client. // layer chunk doesn't need an id nor a client.
...@@ -109,21 +102,11 @@ static void RecordForeignLayerInternal(GraphicsContext& context, ...@@ -109,21 +102,11 @@ static void RecordForeignLayerInternal(GraphicsContext& context,
paint_controller.UpdateCurrentPaintChunkProperties(nullptr, *properties); paint_controller.UpdateCurrentPaintChunkProperties(nullptr, *properties);
} }
paint_controller.CreateAndAppend<ForeignLayerDisplayItem>( paint_controller.CreateAndAppend<ForeignLayerDisplayItem>(
client, type, std::move(layer), offset, json_client); client, type, std::move(layer), offset);
if (properties) { if (properties) {
paint_controller.UpdateCurrentPaintChunkProperties(nullptr, paint_controller.UpdateCurrentPaintChunkProperties(nullptr,
*previous_properties); *previous_properties);
} }
} }
void RecordForeignLayer(GraphicsContext& context,
const DisplayItemClient& client,
DisplayItem::Type type,
scoped_refptr<cc::Layer> layer,
const FloatPoint& offset,
const PropertyTreeState* properties) {
RecordForeignLayerInternal(context, client, type, std::move(layer), offset,
nullptr, properties);
}
} // namespace blink } // namespace blink
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
namespace blink { namespace blink {
class GraphicsContext; class GraphicsContext;
class LayerAsJSONClient;
// Represents foreign content (produced outside Blink) which draws to a layer. // Represents foreign content (produced outside Blink) which draws to a layer.
// A client supplies a layer which can be unwrapped and inserted into the full // A client supplies a layer which can be unwrapped and inserted into the full
...@@ -26,14 +25,11 @@ class PLATFORM_EXPORT ForeignLayerDisplayItem : public DisplayItem { ...@@ -26,14 +25,11 @@ class PLATFORM_EXPORT ForeignLayerDisplayItem : public DisplayItem {
ForeignLayerDisplayItem(const DisplayItemClient& client, ForeignLayerDisplayItem(const DisplayItemClient& client,
Type, Type,
scoped_refptr<cc::Layer>, scoped_refptr<cc::Layer>,
const FloatPoint& offset, const FloatPoint& offset);
const LayerAsJSONClient*);
~ForeignLayerDisplayItem() override; ~ForeignLayerDisplayItem() override;
cc::Layer* GetLayer() const; cc::Layer* GetLayer() const;
const LayerAsJSONClient* GetLayerAsJSONClient() const;
// DisplayItem // DisplayItem
bool Equals(const DisplayItem&) const final; bool Equals(const DisplayItem&) const final;
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
...@@ -44,7 +40,6 @@ class PLATFORM_EXPORT ForeignLayerDisplayItem : public DisplayItem { ...@@ -44,7 +40,6 @@ class PLATFORM_EXPORT ForeignLayerDisplayItem : public DisplayItem {
private: private:
FloatPoint offset_; FloatPoint offset_;
const LayerAsJSONClient* json_client_;
}; };
// When a foreign layer's debug name is a literal string, define a instance of // When a foreign layer's debug name is a literal string, define a instance of
......
...@@ -56,8 +56,7 @@ class TestDisplayItemRequiringSeparateChunk : public ForeignLayerDisplayItem { ...@@ -56,8 +56,7 @@ class TestDisplayItemRequiringSeparateChunk : public ForeignLayerDisplayItem {
: ForeignLayerDisplayItem(client, : ForeignLayerDisplayItem(client,
DisplayItem::kForeignLayerPlugin, DisplayItem::kForeignLayerPlugin,
cc::Layer::Create(), cc::Layer::Create(),
FloatPoint(), FloatPoint()) {}
nullptr) {}
}; };
TEST_F(PaintChunkerTest, Empty) { TEST_F(PaintChunkerTest, Empty) {
......
...@@ -82,8 +82,7 @@ TestPaintArtifact& TestPaintArtifact::ForeignLayer( ...@@ -82,8 +82,7 @@ TestPaintArtifact& TestPaintArtifact::ForeignLayer(
const FloatPoint& offset) { const FloatPoint& offset) {
DEFINE_STATIC_LOCAL(LiteralDebugNameClient, client, ("ForeignLayer")); DEFINE_STATIC_LOCAL(LiteralDebugNameClient, client, ("ForeignLayer"));
display_item_list_.AllocateAndConstruct<ForeignLayerDisplayItem>( display_item_list_.AllocateAndConstruct<ForeignLayerDisplayItem>(
client, DisplayItem::kForeignLayerFirst, std::move(layer), offset, client, DisplayItem::kForeignLayerFirst, std::move(layer), offset);
nullptr);
DidAddDisplayItem(); DidAddDisplayItem();
return *this; return *this;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment