New issue
Advanced search Search tips

Issue 911195 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Revisit high-contrast filter to avoid unnecessary paint copies

Project Member Reported by fmalita@chromium.org, Dec 3

Issue description

The current filter implementation copies all paints on the fly, at draw time, even when the HC feature is disabled.  This introduces unneeded ref-count churn.

Without looking too closely, I think we should be able to avoid these copies.  Some ideas:

- Most paints should be sourced from GraphicsContextState -- apply the HC filter when setting the color, not on paint use.

- Update  ApplyHighContrastFilter to return a lazy/COW value (equivalent to SkTCopyOnFirstWrite).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0ca60079f0a7a43ba19acee8bdbdc3bafa27abc6

commit 0ca60079f0a7a43ba19acee8bdbdc3bafa27abc6
Author: Florin Malita <fmalita@chromium.org>
Date: Thu Dec 27 23:06:47 2018

Avoid PaintFlags copies when high-contrast filtering is disabled

We are currently copying paint flags on the fly/unconditionally in
GraphicsContext::ApplyHighContrastFilter (which is called from most
GC draw primitives).  This is unneeded when high-contrast filtering is
disabled.

Introduce a RAII helper to only triger these copies when required.

Bug: 911195
Change-Id: I9d41670fbe2febe5229851802ea800ce82f758dc
Reviewed-on: https://chromium-review.googlesource.com/c/1391716
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619086}
[modify] https://crrev.com/0ca60079f0a7a43ba19acee8bdbdc3bafa27abc6/third_party/blink/renderer/platform/graphics/graphics_context.cc
[modify] https://crrev.com/0ca60079f0a7a43ba19acee8bdbdc3bafa27abc6/third_party/blink/renderer/platform/graphics/graphics_context.h

Sign in to add a comment