Flutter Engine
The Flutter Engine
crbug_918512.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(crbug_918512, 256, 256, false, 0) {
5// https://crbug.com/918512
6// Verify that PDF draws correctly.
7void draw(SkCanvas* canvas) {
9 {
10 SkAutoCanvasRestore autoCanvasRestore1(canvas, false);
11 canvas->saveLayer(nullptr, nullptr);
12 canvas->drawColor(SK_ColorCYAN);
13 {
14 SkAutoCanvasRestore autoCanvasRestore2(canvas, false);
15 SkPaint lumaFilter;
18 canvas->saveLayer(nullptr, &lumaFilter);
19
22 paint.setColor(SK_ColorGRAY);
23 canvas->drawRect(SkRect{0, 0, 128, 256}, paint);
24 }
25 }
26}
27} // END FIDDLE
@ 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
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
int saveLayer(const SkRect *bounds, const SkPaint *paint)
Definition: SkCanvas.cpp:496
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
Definition: SkCanvas.h:1182
void setBlendMode(SkBlendMode mode)
Definition: SkPaint.cpp:151
void setColorFilter(sk_sp< SkColorFilter > colorFilter)
const Paint & paint
Definition: color_source.cc:38
REG_FIDDLE(crbug_918512, 256, 256, false, 0)
Definition: crbug_918512.cpp:4
static sk_sp< SkColorFilter > Make()