Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: tests/skbug5221.cpp

Issue 2187573002: Reduce usage of MakeRenderTargetDirect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/WritePixelsTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkSurface.h" 10 #include "SkSurface.h"
11 11
12 // This passes by not crashing. 12 // This passes by not crashing.
13 static void test(SkCanvas* canvas) { 13 static void test(SkCanvas* canvas) {
14 SkPaint paint; 14 SkPaint paint;
15 paint.setAntiAlias(true); 15 paint.setAntiAlias(true);
16 canvas->scale(63, 0); 16 canvas->scale(63, 0);
17 static const char kTxt[] = "A"; 17 static const char kTxt[] = "A";
18 canvas->drawText(kTxt, SK_ARRAY_COUNT(kTxt), 50, 50, paint); 18 canvas->drawText(kTxt, SK_ARRAY_COUNT(kTxt), 50, 50, paint);
19 } 19 }
20 20
21 DEF_TEST(skbug5221, r) { 21 DEF_TEST(skbug5221, r) {
22 sk_sp<SkSurface> surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(25 6, 256))); 22 sk_sp<SkSurface> surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(25 6, 256)));
23 test(surface->getCanvas()); 23 test(surface->getCanvas());
24 } 24 }
25 25
26 #if SK_SUPPORT_GPU 26 #if SK_SUPPORT_GPU
27 DEF_GPUTEST_FOR_ALL_CONTEXTS(skbug5221_GPU, r, contextInfo) { 27 DEF_GPUTEST_FOR_ALL_CONTEXTS(skbug5221_GPU, r, contextInfo) {
28 sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(contextInfo.grContext() , SkBudgeted::kYes, 28 sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(contextInfo.grContext() , SkBudgeted::kYes,
29 SkImageInfo::MakeN32Pre mul(256, 256), 0, 29 SkImageInfo::MakeN32Pre mul(256, 256)));
30 nullptr));
31 test(surface->getCanvas()); 30 test(surface->getCanvas());
32 } 31 }
33 #endif 32 #endif
OLDNEW
« no previous file with comments | « tests/WritePixelsTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698