blob: aac4f016cd6ee686f8a4b196227adf6c6e6aeed6 [file] [log] [blame]
John Stilesf2de1b82021-07-16 10:12:24 -04001/*
2 * Copyright 2021 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "tests/Test.h"
9
10#include "include/core/SkCanvas.h"
11#include "include/core/SkSurface.h"
12#include "include/gpu/GrDirectContext.h"
13
14DEF_GPUTEST_FOR_ALL_CONTEXTS(skbug12214, r, contextInfo) {
15 auto imageInfo = SkImageInfo::Make(/*width=*/32, /*height=*/32, kRGBA_8888_SkColorType,
16 kPremul_SkAlphaType);
17 sk_sp<SkSurface> surface1 = SkSurface::MakeRenderTarget(contextInfo.directContext(),
18 SkBudgeted::kNo, imageInfo);
19 sk_sp<SkSurface> surface2 = SkSurface::MakeRaster(imageInfo);
20
21 // The test succeeds if this draw does not crash. (See skia:12214)
22 surface1->draw(surface2->getCanvas(), /*x=*/0, /*y=*/0);
23}