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

Side by Side Diff: core/src/fxge/agg/src/fx_agg_driver.cpp

Issue 1243953004: Re-land else-after-returns (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 5 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 | « core/src/fxcrt/fx_basic_wstring.cpp ('k') | core/src/fxge/dib/fx_dib_composite.cpp » ('j') | 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 "../../../../include/fxge/fx_ge.h" 7 #include "../../../../include/fxge/fx_ge.h"
8 #include "../../dib/dib_int.h" 8 #include "../../dib/dib_int.h"
9 #include "../../ge/text_int.h" 9 #include "../../ge/text_int.h"
10 #include "../../../../include/fxcodec/fx_codec.h" 10 #include "../../../../include/fxcodec/fx_codec.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 ori_scan ++; 410 ori_scan ++;
411 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, r, cover_sca n[col]); 411 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, r, cover_sca n[col]);
412 dest_scan ++; 412 dest_scan ++;
413 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan [col]); 413 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan [col]);
414 dest_scan ++; 414 dest_scan ++;
415 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, b, cover_scan [col]); 415 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, b, cover_scan [col]);
416 dest_scan += 2; 416 dest_scan += 2;
417 } 417 }
418 } 418 }
419 return; 419 return;
420 } else if (Bpp == 3 || Bpp == 4) { 420 }
421 if (Bpp == 3 || Bpp == 4) {
421 for (int col = col_start; col < col_end; col ++) { 422 for (int col = col_start; col < col_end; col ++) {
422 int src_alpha; 423 int src_alpha;
423 if (clip_scan) { 424 if (clip_scan) {
424 src_alpha = m_Alpha * clip_scan[col] / 255 ; 425 src_alpha = m_Alpha * clip_scan[col] / 255 ;
425 } else { 426 } else {
426 src_alpha = m_Alpha; 427 src_alpha = m_Alpha;
427 } 428 }
428 int r = FXDIB_ALPHA_MERGE(*ori_scan++, m_Red, src_alpha); 429 int r = FXDIB_ALPHA_MERGE(*ori_scan++, m_Red, src_alpha);
429 int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_alpha); 430 int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_alpha);
430 int b = FXDIB_ALPHA_MERGE(*ori_scan, m_Blue, src_alpha); 431 int b = FXDIB_ALPHA_MERGE(*ori_scan, m_Blue, src_alpha);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 dest_scan[3] = FXDIB_ALPHA_MERGE(dest_scan[3], src_alpha, co ver); 473 dest_scan[3] = FXDIB_ALPHA_MERGE(dest_scan[3], src_alpha, co ver);
473 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover); 474 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover);
474 dest_scan ++; 475 dest_scan ++;
475 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, cover); 476 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, cover);
476 dest_scan ++; 477 dest_scan ++;
477 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, cover); 478 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, cover);
478 dest_scan += 2; 479 dest_scan += 2;
479 } 480 }
480 } 481 }
481 return; 482 return;
482 } else if (Bpp == 3 || Bpp == 4) { 483 }
484 if (Bpp == 3 || Bpp == 4) {
483 for (int col = col_start; col < col_end; col ++) { 485 for (int col = col_start; col < col_end; col ++) {
484 int src_alpha; 486 int src_alpha;
485 if (clip_scan) { 487 if (clip_scan) {
486 src_alpha = m_Alpha * clip_scan[col] / 255; 488 src_alpha = m_Alpha * clip_scan[col] / 255;
487 } else { 489 } else {
488 src_alpha = m_Alpha; 490 src_alpha = m_Alpha;
489 } 491 }
490 if (m_bFullCover) { 492 if (m_bFullCover) {
491 *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, src_al pha); 493 *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, src_al pha);
492 *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_a lpha); 494 *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_a lpha);
493 *dest_scan = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha); 495 *dest_scan = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha);
494 dest_scan += Bpp - 2; 496 dest_scan += Bpp - 2;
495 ori_scan += Bpp - 2; 497 ori_scan += Bpp - 2;
496 continue; 498 continue;
497 } 499 }
498 int b = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, src_alpha); 500 int b = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, src_alpha);
499 int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_alpha); 501 int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_alpha);
500 int r = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha); 502 int r = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha);
501 ori_scan += Bpp - 2; 503 ori_scan += Bpp - 2;
502 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, cover_scan[col]); 504 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, cover_scan[col]);
503 dest_scan ++; 505 dest_scan ++;
504 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan[col]); 506 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan[col]);
505 dest_scan ++; 507 dest_scan ++;
506 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan[col]); 508 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan[col]);
507 dest_scan += Bpp - 2; 509 dest_scan += Bpp - 2;
508 continue; 510 continue;
509 } 511 }
510 return; 512 return;
511 } else if (Bpp == 1) { 513 }
514 if (Bpp == 1) {
512 for (int col = col_start; col < col_end; col ++) { 515 for (int col = col_start; col < col_end; col ++) {
513 int src_alpha; 516 int src_alpha;
514 if (clip_scan) { 517 if (clip_scan) {
515 src_alpha = m_Alpha * clip_scan[col] / 255; 518 src_alpha = m_Alpha * clip_scan[col] / 255;
516 } else { 519 } else {
517 src_alpha = m_Alpha; 520 src_alpha = m_Alpha;
518 } 521 }
519 if (m_bFullCover) { 522 if (m_bFullCover) {
520 *dest_scan = FXDIB_ALPHA_MERGE(*ori_scan++, m_Gray, src_alph a); 523 *dest_scan = FXDIB_ALPHA_MERGE(*ori_scan++, m_Gray, src_alph a);
521 } else { 524 } else {
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bi ts, FALSE, pOriDevice, FALSE); 1596 IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bi ts, FALSE, pOriDevice, FALSE);
1594 SetDeviceDriver(pDriver); 1597 SetDeviceDriver(pDriver);
1595 return TRUE; 1598 return TRUE;
1596 } 1599 }
1597 CFX_FxgeDevice::~CFX_FxgeDevice() 1600 CFX_FxgeDevice::~CFX_FxgeDevice()
1598 { 1601 {
1599 if (m_bOwnedBitmap) { 1602 if (m_bOwnedBitmap) {
1600 delete GetBitmap(); 1603 delete GetBitmap();
1601 } 1604 }
1602 } 1605 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_wstring.cpp ('k') | core/src/fxge/dib/fx_dib_composite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698