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

Side by Side Diff: tests/SpecialImageTest.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/SRGBReadWritePixelsTest.cpp ('k') | tests/SurfaceTest.cpp » ('j') | 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 #if SK_SUPPORT_GPU 128 #if SK_SUPPORT_GPU
129 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_Gpu, reporter, context) { 129 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_Gpu, reporter, context) {
130 SkBitmap bm = create_bm(); 130 SkBitmap bm = create_bm();
131 131
132 GrSurfaceDesc desc; 132 GrSurfaceDesc desc;
133 desc.fConfig = kSkia8888_GrPixelConfig; 133 desc.fConfig = kSkia8888_GrPixelConfig;
134 desc.fFlags = kNone_GrSurfaceFlags; 134 desc.fFlags = kNone_GrSurfaceFlags;
135 desc.fWidth = kFullSize; 135 desc.fWidth = kFullSize;
136 desc.fHeight = kFullSize; 136 desc.fHeight = kFullSize;
137 137
138 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(de sc, SkBudgeted::kNo, 138 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(de sc, false,
139 bm .getPixels(), 0)); 139 bm .getPixels(), 0));
140 if (!texture) { 140 if (!texture) {
141 return; 141 return;
142 } 142 }
143 143
144 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size); 144 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size);
145 145
146 SkAutoTUnref<SkSpecialImage> img(SkSpecialImage::NewFromGpu(nullptr, subset, 146 SkAutoTUnref<SkSpecialImage> img(SkSpecialImage::NewFromGpu(nullptr, subset,
147 kNeedNewImageUni queID_SpecialImage, 147 kNeedNewImageUni queID_SpecialImage,
148 texture)); 148 texture));
149 test_image(img, reporter, false, true); 149 test_image(img, reporter, false, true);
150 } 150 }
151 151
152 #endif 152 #endif
OLDNEW
« no previous file with comments | « tests/SRGBReadWritePixelsTest.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698