Commit 0b3c5cb7 authored by Xu Xing's avatar Xu Xing Committed by Commit Bot

Change the overdraw color to a GPU friendly color

When skia works in CPU mode, color should be 0x00000000, 0x00000000,0x2f0000ff,
0x2f00ff00, 0x3fff0000, 0x7fff0000. When it turns to GPU, the R and B should be
swapped.

Skia mainly works in GPU mode, so change this color to a GPU friendly color.

However, the best solution is to support both CPU mode and GPU mode. Add TODO
for this.

Bug: 889122
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I71aa1d2ae34ab10a41ba5d58e1e2cbb6867bec6b
Reviewed-on: https://chromium-review.googlesource.com/c/1253407Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: Xing Xu <xing.xu@intel.com>
Cr-Commit-Position: refs/heads/master@{#601344}
parent 55100ec8
......@@ -264,8 +264,10 @@ void SkiaRenderer::FinishDrawingFrame() {
if (settings_->show_overdraw_feedback) {
sk_sp<SkImage> image = overdraw_surface_->makeImageSnapshot();
SkPaint paint;
// TODO(xing.xu) : handle this in CPU mode, the R and B should be switched
// in CPU mode. (http://crbug.com/896969)
static const SkPMColor colors[SkOverdrawColorFilter::kNumColors] = {
0x00000000, 0x00000000, 0x2f0000ff, 0x2f00ff00, 0x3fff0000, 0x7fff0000,
0x00000000, 0x00000000, 0x2fff0000, 0x2f00ff00, 0x3f0000ff, 0x7f0000ff,
};
sk_sp<SkColorFilter> color_filter = SkOverdrawColorFilter::Make(colors);
paint.setColorFilter(color_filter);
......
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