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

Unified Diff: src/gpu/SkGr.cpp

Issue 1351533004: share code between SkGr and Cacherator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: captured strict check in a helper function Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index ee06f3eef6de89787bbb747d714304bd82c2a77e..9ab2f6393aff26fa40be7b427bb693565602ee76 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -205,12 +205,14 @@ static void make_image_keys(uint32_t imageID, const SkIRect& subset, const Stret
}
}
-static void generate_bitmap_texture_desc(const SkBitmap& bitmap, GrSurfaceDesc* desc) {
- desc->fFlags = kNone_GrSurfaceFlags;
- desc->fWidth = bitmap.width();
- desc->fHeight = bitmap.height();
- desc->fConfig = SkImageInfo2GrPixelConfig(bitmap.info());
- desc->fSampleCnt = 0;
+GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo& info) {
+ GrSurfaceDesc desc;
+ desc.fFlags = kNone_GrSurfaceFlags;
+ desc.fWidth = info.width();
+ desc.fHeight = info.height();
+ desc.fConfig = SkImageInfo2GrPixelConfig(info);
+ desc.fSampleCnt = 0;
+ return desc;
}
namespace {
@@ -433,8 +435,7 @@ static GrTexture* create_unstretched_bitmap_texture(GrContext* ctx,
const SkBitmap* bitmap = &origBitmap;
- GrSurfaceDesc desc;
- generate_bitmap_texture_desc(*bitmap, &desc);
+ GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap->info());
const GrCaps* caps = ctx->caps();
if (kIndex_8_SkColorType == bitmap->colorType()) {
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698