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

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

Issue 1376603006: remove unused helper function (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « include/gpu/SkGr.h ('k') | no next file » | 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 make_stretched_key(key, stretch, &stretchedKey); 513 make_stretched_key(key, stretch, &stretchedKey);
514 return ctx->textureProvider()->existsTextureWithUniqueKey(stretchedKey); 514 return ctx->textureProvider()->existsTextureWithUniqueKey(stretchedKey);
515 } 515 }
516 516
517 GrUniqueKey key, stretchedKey; 517 GrUniqueKey key, stretchedKey;
518 make_image_keys(imageID, subset, stretch, &key, &stretchedKey); 518 make_image_keys(imageID, subset, stretch, &key, &stretchedKey);
519 return ctx->textureProvider()->existsTextureWithUniqueKey( 519 return ctx->textureProvider()->existsTextureWithUniqueKey(
520 (SkGrStretch::kNone_Type == stretch.fType) ? key : stretchedKey); 520 (SkGrStretch::kNone_Type == stretch.fType) ? key : stretchedKey);
521 } 521 }
522 522
523 bool GrIsBitmapInCache(const GrContext* ctx, const SkBitmap& bitmap,
524 const GrTextureParams* params) {
525 if (bitmap.isVolatile()) {
526 return false; // we don't cache volatile bitmaps.
527 }
528 return GrIsImageInCache(ctx, bitmap.getGenerationID(), bitmap.getSubset(), b itmap.getTexture(),
529 params);
530 }
531
532 class Bitmap_GrTextureMaker : public GrTextureMaker { 523 class Bitmap_GrTextureMaker : public GrTextureMaker {
533 public: 524 public:
534 Bitmap_GrTextureMaker(const SkBitmap& bitmap) 525 Bitmap_GrTextureMaker(const SkBitmap& bitmap)
535 : INHERITED(bitmap.width(), bitmap.height()) 526 : INHERITED(bitmap.width(), bitmap.height())
536 , fBitmap(bitmap) 527 , fBitmap(bitmap)
537 {} 528 {}
538 529
539 protected: 530 protected:
540 GrTexture* onRefUnstretchedTexture(GrContext* ctx) override { 531 GrTexture* onRefUnstretchedTexture(GrContext* ctx) override {
541 GrTexture* tex = fBitmap.getTexture(); 532 GrTexture* tex = fBitmap.getTexture();
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 SkBitmap stretchedBmp = stretch_on_cpu(bitmap, stretch); 949 SkBitmap stretchedBmp = stretch_on_cpu(bitmap, stretch);
959 return create_unstretched_bitmap_texture(ctx, stretchedBmp, GrUniqueKey( )); 950 return create_unstretched_bitmap_texture(ctx, stretchedBmp, GrUniqueKey( ));
960 } else { 951 } else {
961 SkAutoTUnref<GrTexture> unstretched(this->onRefUnstretchedTexture(ctx)); 952 SkAutoTUnref<GrTexture> unstretched(this->onRefUnstretchedTexture(ctx));
962 if (!unstretched) { 953 if (!unstretched) {
963 return nullptr; 954 return nullptr;
964 } 955 }
965 return stretch_texture(unstretched, stretch, nullptr, GrUniqueKey()); 956 return stretch_texture(unstretched, stretch, nullptr, GrUniqueKey());
966 } 957 }
967 } 958 }
OLDNEW
« no previous file with comments | « include/gpu/SkGr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698