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

Side by Side Diff: tests/ReadWriteAlphaTest.cpp

Issue 848903004: Require budget decision when creating a RenderTarget SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address initial comments Created 5 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 9
10 // This test is specific to the GPU backend. 10 // This test is specific to the GPU backend.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (textureData[x][y] != readback[x][y]) { 76 if (textureData[x][y] != readback[x][y]) {
77 match = false; 77 match = false;
78 } 78 }
79 } 79 }
80 } 80 }
81 81
82 REPORTER_ASSERT(reporter, match); 82 REPORTER_ASSERT(reporter, match);
83 83
84 // Now try writing on the single channel texture 84 // Now try writing on the single channel texture
85 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(texture->asRenderT arget(), 85 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(texture->asRenderT arget(),
86 SkSurfaceProps(SkSurfaceProps::kLegacyFont Host_InitType))); 86 &SkSurfaceProps(SkSurfaceProps::kLegacyFon tHost_InitType)));
87 SkCanvas canvas(device); 87 SkCanvas canvas(device);
88 88
89 SkPaint paint; 89 SkPaint paint;
90 90
91 const SkRect rect = SkRect::MakeLTRB(-10, -10, X_SIZE + 10, Y_SIZE + 10) ; 91 const SkRect rect = SkRect::MakeLTRB(-10, -10, X_SIZE + 10, Y_SIZE + 10) ;
92 92
93 paint.setColor(SK_ColorWHITE); 93 paint.setColor(SK_ColorWHITE);
94 94
95 canvas.drawRect(rect, paint); 95 canvas.drawRect(rect, paint);
96 96
97 texture->readPixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, 97 texture->readPixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
98 readback, 0); 98 readback, 0);
99 99
100 match = true; 100 match = true;
101 101
102 for (int y = 0; y < Y_SIZE; ++y) { 102 for (int y = 0; y < Y_SIZE; ++y) {
103 for (int x = 0; x < X_SIZE; ++x) { 103 for (int x = 0; x < X_SIZE; ++x) {
104 if (0xFF != readback[x][y]) { 104 if (0xFF != readback[x][y]) {
105 match = false; 105 match = false;
106 } 106 }
107 } 107 }
108 } 108 }
109 109
110 REPORTER_ASSERT(reporter, match); 110 REPORTER_ASSERT(reporter, match);
111 } 111 }
112 } 112 }
113 113
114 #endif 114 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698