OLD | NEW |
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 Loading... |
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, false, | 138 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(de
sc, SkBudgeted::kNo, |
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 |
OLD | NEW |