Commit 923f4596 authored by Findit's avatar Findit

Revert "[Paint Preview] Inject PaintPreviewTracker"

This reverts commit 2c483e93.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 703720 as the
culprit for failures in the build cycles as shown on:
https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtLzJjNDgzZTkzODU4MTgyODM3MTdiNDUxZjEwMjdmOWM1NzFhYzVjNDYM

Sample Failed Build: https://ci.chromium.org/buildbot/chromium.memory/Linux%20MSan%20Tests/19798

Sample Failed Step: browser_tests

Original change's description:
> [Paint Preview] Inject PaintPreviewTracker
> 
> Adds the ability to inject paint_preview::PaintPreviewTracker into
> blink::GraphicsContext to act similarly to printing::MetafileSkia.
> This class will track various metadata about the Paint Preview
> capture process.
> 
> Design Doc: go/fdt-design (internal)
> Part of Landing: crrev/1786583
> 
> Bug: 1008885
> Change-Id: Iba2819491bee7b284de62a1bf888aa9486c788cf
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829277
> Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
> Reviewed-by: Ian Vollick <vollick@chromium.org>
> Auto-Submit: Calder Kitagawa <ckitagawa@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#703720}


Change-Id: Id0364a41756df743ed5af5aa64e991da34ba2e1b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1008885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1846727
Cr-Commit-Position: refs/heads/master@{#703874}
parent c4e8370e
......@@ -1468,7 +1468,6 @@ jumbo_component("platform") {
deps = [
":platform_export",
"//base/allocator:buildflags",
"//components/paint_preview/common",
"//components/viz/client",
"//components/viz/common",
"//crypto",
......
......@@ -11,7 +11,6 @@ include_rules = [
"+base/barrier_closure.h",
"+base/callback_helpers.h",
"+cc",
"+components/paint_preview/common",
"+components/viz/client",
"+components/viz/common",
"+gpu/config",
......
......@@ -30,7 +30,6 @@
#include "base/optional.h"
#include "build/build_config.h"
#include "components/paint_preview/common/paint_preview_tracker.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/blink/renderer/platform/fonts/text_run_paint_info.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h"
......@@ -90,14 +89,12 @@ class GraphicsContext::DarkModeFlags final {
GraphicsContext::GraphicsContext(PaintController& paint_controller,
DisabledMode disable_context_or_painting,
printing::MetafileSkia* metafile,
paint_preview::PaintPreviewTracker* tracker)
printing::MetafileSkia* metafile)
: canvas_(nullptr),
paint_controller_(paint_controller),
paint_state_stack_(),
paint_state_index_(0),
metafile_(metafile),
tracker_(tracker),
#if DCHECK_IS_ON()
layer_count_(0),
disable_destruction_checks_(false),
......@@ -1371,12 +1368,6 @@ void GraphicsContext::SetURLForRect(const KURL& link,
return;
DCHECK(canvas_);
// Intercept URL rects when painting previews.
if (IsPaintingPreview() && tracker_) {
tracker_->AnnotateLink(link.GetString().Utf8(), dest_rect);
return;
}
sk_sp<SkData> url(SkData::MakeWithCString(link.GetString().Utf8().c_str()));
canvas_->Annotate(cc::PaintCanvas::AnnotationType::URL, dest_rect,
std::move(url));
......@@ -1388,12 +1379,6 @@ void GraphicsContext::SetURLFragmentForRect(const String& dest_name,
return;
DCHECK(canvas_);
// Intercept URL rects when painting previews.
if (IsPaintingPreview() && tracker_) {
tracker_->AnnotateLink(dest_name.Utf8(), rect);
return;
}
sk_sp<SkData> sk_dest_name(SkData::MakeWithCString(dest_name.Utf8().c_str()));
canvas_->Annotate(cc::PaintCanvas::AnnotationType::LINK_TO_DESTINATION, rect,
std::move(sk_dest_name));
......
......@@ -53,10 +53,6 @@ class SkPath;
class SkRRect;
struct SkRect;
namespace paint_preview {
class PaintPreviewTracker;
} // namespace paint_preview
namespace blink {
class FloatRect;
......@@ -78,8 +74,7 @@ class PLATFORM_EXPORT GraphicsContext {
explicit GraphicsContext(PaintController&,
DisabledMode = kNothingDisabled,
printing::MetafileSkia* = nullptr,
paint_preview::PaintPreviewTracker* = nullptr);
printing::MetafileSkia* = nullptr);
~GraphicsContext();
......@@ -166,19 +161,6 @@ class PLATFORM_EXPORT GraphicsContext {
bool Printing() const { return printing_; }
void SetPrinting(bool printing) { printing_ = printing; }
// Returns if the context is saving a paint preview instead of displaying.
// In such cases, clipping should not occur.
bool IsPaintingPreview() const { return is_painting_preview_; }
void SetIsPaintingPreview(bool is_painting_preview) {
is_painting_preview_ = is_painting_preview;
}
// Returns if the context is printing or painting a preview. Many of the
// behaviors required for printing and paint previews are shared.
bool IsPrintingOrPaintingPreview() const {
return Printing() || IsPaintingPreview();
}
SkColorFilter* GetColorFilter() const;
void SetColorFilter(ColorFilter);
// ---------- End state management methods -----------------
......@@ -516,7 +498,6 @@ class PLATFORM_EXPORT GraphicsContext {
PaintRecorder paint_recorder_;
printing::MetafileSkia* metafile_;
paint_preview::PaintPreviewTracker* tracker_;
#if DCHECK_IS_ON()
int layer_count_;
......@@ -531,7 +512,6 @@ class PLATFORM_EXPORT GraphicsContext {
DarkModeFilter dark_mode_filter_;
unsigned printing_ : 1;
unsigned is_painting_preview_ : 1;
unsigned in_drawing_recorder_ : 1;
DISALLOW_COPY_AND_ASSIGN(GraphicsContext);
......
......@@ -10,11 +10,9 @@
namespace blink {
PaintRecordBuilder::PaintRecordBuilder(
printing::MetafileSkia* metafile,
GraphicsContext* containing_context,
PaintController* paint_controller,
paint_preview::PaintPreviewTracker* tracker)
PaintRecordBuilder::PaintRecordBuilder(printing::MetafileSkia* metafile,
GraphicsContext* containing_context,
PaintController* paint_controller)
: paint_controller_(nullptr) {
GraphicsContext::DisabledMode disabled_mode =
GraphicsContext::kNothingDisabled;
......@@ -32,13 +30,12 @@ PaintRecordBuilder::PaintRecordBuilder(
paint_controller_->UpdateCurrentPaintChunkProperties(
base::nullopt, PropertyTreeState::Root());
context_ = std::make_unique<GraphicsContext>(
*paint_controller_, disabled_mode, metafile, tracker);
context_ = std::make_unique<GraphicsContext>(*paint_controller_,
disabled_mode, metafile);
if (containing_context) {
context_->SetDarkMode(containing_context->dark_mode_settings());
context_->SetDeviceScaleFactor(containing_context->DeviceScaleFactor());
context_->SetPrinting(containing_context->Printing());
context_->SetIsPaintingPreview(containing_context->IsPaintingPreview());
}
}
......
......@@ -19,15 +19,12 @@ namespace cc {
class PaintCanvas;
}
namespace paint_preview {
class PaintPreviewTracker;
}
namespace blink {
class GraphicsContext;
class PaintController;
class PLATFORM_EXPORT PaintRecordBuilder final : public DisplayItemClient {
public:
// Constructs a new builder for the resulting paint record. If |metadata|
// is specified, that metadata is propagated to the builder's internal canvas.
......@@ -42,8 +39,7 @@ class PLATFORM_EXPORT PaintRecordBuilder final : public DisplayItemClient {
// CompositeAfterPaint.
PaintRecordBuilder(printing::MetafileSkia* metafile = nullptr,
GraphicsContext* containing_context = nullptr,
PaintController* = nullptr,
paint_preview::PaintPreviewTracker* tracker = nullptr);
PaintController* = nullptr);
~PaintRecordBuilder() override;
GraphicsContext& Context() { return *context_; }
......
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