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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 1404823005: GrDrawContext now holds GrRenderTarget pointer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix overlength line Created 5 years, 2 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 | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.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 2010 Google Inc. 2 * Copyright 2010 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 "GrTextureMaker.h" 8 #include "GrTextureMaker.h"
9 9
10 #include "SkGr.h" 10 #include "SkGr.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // copies of texels from the original. 278 // copies of texels from the original.
279 GrTextureParams params(SkShader::kClamp_TileMode, 279 GrTextureParams params(SkShader::kClamp_TileMode,
280 SkGrStretch::kBilerp_Type == stretch.fType ? 280 SkGrStretch::kBilerp_Type == stretch.fType ?
281 GrTextureParams::kBilerp_FilterMode : 281 GrTextureParams::kBilerp_FilterMode :
282 GrTextureParams::kNone_FilterMode); 282 GrTextureParams::kNone_FilterMode);
283 paint.addColorTextureProcessor(inputTexture, SkMatrix::I(), params); 283 paint.addColorTextureProcessor(inputTexture, SkMatrix::I(), params);
284 284
285 SkRect rect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtD esc.fHeight)); 285 SkRect rect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtD esc.fHeight));
286 SkRect localRect = SkRect::MakeWH(1.f, 1.f); 286 SkRect localRect = SkRect::MakeWH(1.f, 1.f);
287 287
288 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext()); 288 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(stretched->asRe nderTarget()));
289 if (!drawContext) { 289 if (!drawContext) {
290 return nullptr; 290 return nullptr;
291 } 291 }
292 292
293 drawContext->drawNonAARectToRect(stretched->asRenderTarget(), GrClip::WideOp en(), paint, 293 drawContext->drawNonAARectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), r ect, localRect);
294 SkMatrix::I(), rect, localRect);
295 294
296 return stretched.detach(); 295 return stretched.detach();
297 } 296 }
298 297
299 GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, 298 GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
300 int expectedW, int expectedH, 299 int expectedW, int expectedH,
301 const void** outStartOfDataToUp load) { 300 const void** outStartOfDataToUp load) {
302 *outStartOfDataToUpload = nullptr; 301 *outStartOfDataToUpload = nullptr;
303 #ifndef SK_IGNORE_ETC1_SUPPORT 302 #ifndef SK_IGNORE_ETC1_SUPPORT
304 if (!ctx->caps()->isConfigTexturable(kETC1_GrPixelConfig)) { 303 if (!ctx->caps()->isConfigTexturable(kETC1_GrPixelConfig)) {
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 SkBitmap stretchedBmp = stretch_on_cpu(bitmap, stretch); 918 SkBitmap stretchedBmp = stretch_on_cpu(bitmap, stretch);
920 return create_unstretched_bitmap_texture(ctx, stretchedBmp, GrUniqueKey( )); 919 return create_unstretched_bitmap_texture(ctx, stretchedBmp, GrUniqueKey( ));
921 } else { 920 } else {
922 SkAutoTUnref<GrTexture> unstretched(this->onRefUnstretchedTexture(ctx)); 921 SkAutoTUnref<GrTexture> unstretched(this->onRefUnstretchedTexture(ctx));
923 if (!unstretched) { 922 if (!unstretched) {
924 return nullptr; 923 return nullptr;
925 } 924 }
926 return stretch_texture(unstretched, stretch, nullptr, GrUniqueKey()); 925 return stretch_texture(unstretched, stretch, nullptr, GrUniqueKey());
927 } 926 }
928 } 927 }
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698