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

Side by Side Diff: fpdfsdk/pdfwindow/PWL_Utils.cpp

Issue 2326883002: CPWL_Color::ConvertColorType should compare current color type with the given convert color type. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "fpdfsdk/pdfwindow/PWL_Utils.h" 7 #include "fpdfsdk/pdfwindow/PWL_Utils.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after
3301 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.90f, crInBox.top), 3301 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.90f, crInBox.top),
3302 PWLPT_LINETO), 3302 PWLPT_LINETO),
3303 }; 3303 };
3304 3304
3305 if (type == PWLPT_STREAM) 3305 if (type == PWLPT_STREAM)
3306 sPathData = GetAppStreamFromArray(PathArray, 23); 3306 sPathData = GetAppStreamFromArray(PathArray, 23);
3307 else 3307 else
3308 GetPathDataFromArray(path, PathArray, 23); 3308 GetPathDataFromArray(path, PathArray, 23);
3309 } 3309 }
3310 3310
3311 void CPWL_Color::ConvertColorType(int32_t other_nColorType) { 3311 void CPWL_Color::ConvertColorType(int32_t nConvertColorType) {
3312 switch (other_nColorType) { 3312 if (nColorType == nConvertColorType)
3313 return;
3314
3315 switch (nColorType) {
dsinclair 2016/09/09 00:09:26 Are we sure nColorType is the correct item for the
jaepark 2016/09/09 00:39:41 Since the inner switch is calling functions OUTER2
3313 case COLORTYPE_TRANSPARENT: 3316 case COLORTYPE_TRANSPARENT:
3314 break; 3317 break;
3315 case COLORTYPE_GRAY: 3318 case COLORTYPE_GRAY:
3316 switch (other_nColorType) { 3319 switch (nConvertColorType) {
3317 case COLORTYPE_RGB: 3320 case COLORTYPE_RGB:
3318 CPWL_Utils::ConvertGRAY2RGB(fColor1, fColor1, fColor2, fColor3); 3321 CPWL_Utils::ConvertGRAY2RGB(fColor1, fColor1, fColor2, fColor3);
3319 break; 3322 break;
3320 case COLORTYPE_CMYK: 3323 case COLORTYPE_CMYK:
3321 CPWL_Utils::ConvertGRAY2CMYK(fColor1, fColor1, fColor2, fColor3, 3324 CPWL_Utils::ConvertGRAY2CMYK(fColor1, fColor1, fColor2, fColor3,
3322 fColor4); 3325 fColor4);
3323 break; 3326 break;
3324 } 3327 }
3325 break; 3328 break;
3326 case COLORTYPE_RGB: 3329 case COLORTYPE_RGB:
3327 switch (other_nColorType) { 3330 switch (nConvertColorType) {
3328 case COLORTYPE_GRAY: 3331 case COLORTYPE_GRAY:
3329 CPWL_Utils::ConvertRGB2GRAY(fColor1, fColor2, fColor3, fColor1); 3332 CPWL_Utils::ConvertRGB2GRAY(fColor1, fColor2, fColor3, fColor1);
3330 break; 3333 break;
3331 case COLORTYPE_CMYK: 3334 case COLORTYPE_CMYK:
3332 CPWL_Utils::ConvertRGB2CMYK(fColor1, fColor2, fColor3, fColor1, 3335 CPWL_Utils::ConvertRGB2CMYK(fColor1, fColor2, fColor3, fColor1,
3333 fColor2, fColor3, fColor4); 3336 fColor2, fColor3, fColor4);
3334 break; 3337 break;
3335 } 3338 }
3336 break; 3339 break;
3337 case COLORTYPE_CMYK: 3340 case COLORTYPE_CMYK:
3338 switch (other_nColorType) { 3341 switch (nConvertColorType) {
3339 case COLORTYPE_GRAY: 3342 case COLORTYPE_GRAY:
3340 CPWL_Utils::ConvertCMYK2GRAY(fColor1, fColor2, fColor3, fColor4, 3343 CPWL_Utils::ConvertCMYK2GRAY(fColor1, fColor2, fColor3, fColor4,
3341 fColor1); 3344 fColor1);
3342 break; 3345 break;
3343 case COLORTYPE_RGB: 3346 case COLORTYPE_RGB:
3344 CPWL_Utils::ConvertCMYK2RGB(fColor1, fColor2, fColor3, fColor4, 3347 CPWL_Utils::ConvertCMYK2RGB(fColor1, fColor2, fColor3, fColor4,
3345 fColor1, fColor2, fColor3); 3348 fColor1, fColor2, fColor3);
3346 break; 3349 break;
3347 } 3350 }
3348 break; 3351 break;
3349 } 3352 }
3350 nColorType = other_nColorType; 3353 nColorType = nConvertColorType;
3351 } 3354 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698