| OLD | NEW |
| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 // copies of texels from the original. | 270 // copies of texels from the original. |
| 271 GrTextureParams params(SkShader::kClamp_TileMode, | 271 GrTextureParams params(SkShader::kClamp_TileMode, |
| 272 SkGrStretch::kBilerp_Type == stretch.fType ? | 272 SkGrStretch::kBilerp_Type == stretch.fType ? |
| 273 GrTextureParams::kBilerp_FilterMode : | 273 GrTextureParams::kBilerp_FilterMode : |
| 274 GrTextureParams::kNone_FilterMode); | 274 GrTextureParams::kNone_FilterMode); |
| 275 paint.addColorTextureProcessor(inputTexture, SkMatrix::I(), params); | 275 paint.addColorTextureProcessor(inputTexture, SkMatrix::I(), params); |
| 276 | 276 |
| 277 SkRect rect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtD
esc.fHeight)); | 277 SkRect rect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtD
esc.fHeight)); |
| 278 SkRect localRect = SkRect::MakeWH(1.f, 1.f); | 278 SkRect localRect = SkRect::MakeWH(1.f, 1.f); |
| 279 | 279 |
| 280 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(stretched->asRe
nderTarget())); | 280 SkAutoTUnref<GrDrawContext> drawContext( |
| 281 context->drawingMgr().drawContext(stretched->asR
enderTarget())); |
| 281 if (!drawContext) { | 282 if (!drawContext) { |
| 282 return nullptr; | 283 return nullptr; |
| 283 } | 284 } |
| 284 | 285 |
| 285 drawContext->drawNonAARectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), r
ect, localRect); | 286 drawContext->drawNonAARectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), r
ect, localRect); |
| 286 | 287 |
| 287 return stretched.detach(); | 288 return stretched.detach(); |
| 288 } | 289 } |
| 289 | 290 |
| 290 GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, | 291 GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 SkBitmap stretchedBmp = stretch_on_cpu(bitmap, stretch); | 886 SkBitmap stretchedBmp = stretch_on_cpu(bitmap, stretch); |
| 886 return create_unstretched_bitmap_texture(ctx, stretchedBmp, GrUniqueKey(
)); | 887 return create_unstretched_bitmap_texture(ctx, stretchedBmp, GrUniqueKey(
)); |
| 887 } else { | 888 } else { |
| 888 SkAutoTUnref<GrTexture> unstretched(this->onRefUnstretchedTexture(ctx)); | 889 SkAutoTUnref<GrTexture> unstretched(this->onRefUnstretchedTexture(ctx)); |
| 889 if (!unstretched) { | 890 if (!unstretched) { |
| 890 return nullptr; | 891 return nullptr; |
| 891 } | 892 } |
| 892 return stretch_texture(unstretched, stretch, nullptr, GrUniqueKey()); | 893 return stretch_texture(unstretched, stretch, nullptr, GrUniqueKey()); |
| 893 } | 894 } |
| 894 } | 895 } |
| OLD | NEW |