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

Unified Diff: src/images/SkImageDecoder_libjpeg.cpp

Issue 663093004: Clean up some warnings about unused code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/views/mac/skia_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libjpeg.cpp
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index 21e96be2d3049e091a48ef1728bf7554522ad684..4103eefede3b0ffc5dd8586586d73f4537ce348d 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -749,66 +749,6 @@ static SkISize compute_yuv_size(const jpeg_decompress_struct& info, int componen
info.cur_comp_info[component]->downsampled_height);
}
-// Enum for YUV decoding
-enum YUVSubsampling {
- kUNKNOWN_YUVSubsampling,
- k410_YUVSubsampling,
- k411_YUVSubsampling,
- k420_YUVSubsampling,
- k422_YUVSubsampling,
- k440_YUVSubsampling,
- k444_YUVSubsampling
-};
-
-static YUVSubsampling yuv_subsampling(const jpeg_decompress_struct& info) {
- if ((DCTSIZE == 8)
- && (info.num_components == 3)
- && (info.comps_in_scan >= info.num_components)
- && (info.scale_denom <= 8)
- && (info.cur_comp_info[0])
- && (info.cur_comp_info[1])
- && (info.cur_comp_info[2])
- && (info.cur_comp_info[1]->h_samp_factor == 1)
- && (info.cur_comp_info[1]->v_samp_factor == 1)
- && (info.cur_comp_info[2]->h_samp_factor == 1)
- && (info.cur_comp_info[2]->v_samp_factor == 1))
- {
- int h = info.cur_comp_info[0]->h_samp_factor;
- int v = info.cur_comp_info[0]->v_samp_factor;
- // 4:4:4 : (h == 1) && (v == 1)
- // 4:4:0 : (h == 1) && (v == 2)
- // 4:2:2 : (h == 2) && (v == 1)
- // 4:2:0 : (h == 2) && (v == 2)
- // 4:1:1 : (h == 4) && (v == 1)
- // 4:1:0 : (h == 4) && (v == 2)
- if (v == 1) {
- switch (h) {
- case 1:
- return k444_YUVSubsampling;
- case 2:
- return k422_YUVSubsampling;
- case 4:
- return k411_YUVSubsampling;
- default:
- break;
- }
- } else if (v == 2) {
- switch (h) {
- case 1:
- return k440_YUVSubsampling;
- case 2:
- return k420_YUVSubsampling;
- case 4:
- return k410_YUVSubsampling;
- default:
- break;
- }
- }
- }
-
- return kUNKNOWN_YUVSubsampling;
-}
-
static void update_components_sizes(const jpeg_decompress_struct& cinfo, SkISize componentSizes[3],
SizeType sizeType) {
for (int i = 0; i < 3; ++i) {
« no previous file with comments | « no previous file | src/views/mac/skia_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698