Flutter Engine
The Flutter Engine
crbug_918512.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
4#include "gm/gm.h"
10#include "include/core/SkRect.h"
12
13// PDF backend should produce correct results.
14DEF_SIMPLE_GM(crbug_918512, canvas, 256, 256) {
15 canvas->drawColor(SK_ColorYELLOW);
16 {
17 SkAutoCanvasRestore autoCanvasRestore1(canvas, false);
18 canvas->saveLayer(nullptr, nullptr);
19 canvas->drawColor(SK_ColorCYAN);
20 {
21 SkAutoCanvasRestore autoCanvasRestore2(canvas, false);
22 SkPaint lumaFilter;
25 canvas->saveLayer(nullptr, &lumaFilter);
26
27 canvas->drawColor(SK_ColorTRANSPARENT);
29 paint.setColor(SK_ColorGRAY);
30 canvas->drawRect(SkRect{0, 0, 128, 256}, paint);
31 }
32 }
33}
@ kDstIn
r = d * sa
constexpr SkColor SK_ColorYELLOW
Definition: SkColor.h:139
constexpr SkColor SK_ColorCYAN
Definition: SkColor.h:143
constexpr SkColor SK_ColorTRANSPARENT
Definition: SkColor.h:99
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
void setBlendMode(SkBlendMode mode)
Definition: SkPaint.cpp:151
void setColorFilter(sk_sp< SkColorFilter > colorFilter)
const Paint & paint
Definition: color_source.cc:38
DEF_SIMPLE_GM(crbug_918512, canvas, 256, 256)
static sk_sp< SkColorFilter > Make()