| 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 | 8 |
| 9 #include "SkGr.h" | 9 #include "SkGr.h" |
| 10 | 10 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 { | 284 { |
| 285 if (!bitmap.isVolatile()) { | 285 if (!bitmap.isVolatile()) { |
| 286 SkIPoint origin = bitmap.pixelRefOrigin(); | 286 SkIPoint origin = bitmap.pixelRefOrigin(); |
| 287 SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, bitmap.widt
h(), | 287 SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, bitmap.widt
h(), |
| 288 bitmap.height()); | 288 bitmap.height()); |
| 289 GrMakeKeyFromImageID(&fOriginalKey, bitmap.pixelRef()->getGeneration
ID(), subset); | 289 GrMakeKeyFromImageID(&fOriginalKey, bitmap.pixelRef()->getGeneration
ID(), subset); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 protected: | 293 protected: |
| 294 GrTexture* refOriginalTexture(GrContext* ctx) { | 294 GrTexture* refOriginalTexture(GrContext* ctx) override { |
| 295 GrTexture* tex = fBitmap.getTexture(); | 295 GrTexture* tex = fBitmap.getTexture(); |
| 296 if (tex) { | 296 if (tex) { |
| 297 return SkRef(tex); | 297 return SkRef(tex); |
| 298 } | 298 } |
| 299 | 299 |
| 300 if (fOriginalKey.isValid()) { | 300 if (fOriginalKey.isValid()) { |
| 301 tex = ctx->textureProvider()->findAndRefTextureByUniqueKey(fOriginal
Key); | 301 tex = ctx->textureProvider()->findAndRefTextureByUniqueKey(fOriginal
Key); |
| 302 if (tex) { | 302 if (tex) { |
| 303 return tex; | 303 return tex; |
| 304 } | 304 } |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 SkErrorInternals::SetError( kInvalidPaint_SkError, | 666 SkErrorInternals::SetError( kInvalidPaint_SkError, |
| 667 "Sorry, I don't understand the filtering
" | 667 "Sorry, I don't understand the filtering
" |
| 668 "mode you asked for. Falling back to " | 668 "mode you asked for. Falling back to " |
| 669 "MIPMaps."); | 669 "MIPMaps."); |
| 670 textureFilterMode = GrTextureParams::kMipMap_FilterMode; | 670 textureFilterMode = GrTextureParams::kMipMap_FilterMode; |
| 671 break; | 671 break; |
| 672 | 672 |
| 673 } | 673 } |
| 674 return textureFilterMode; | 674 return textureFilterMode; |
| 675 } | 675 } |
| OLD | NEW |