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

Side by Side Diff: core/src/fxge/agg/agg23/fx_agg_rasterizer_scanline_aa.cpp

Issue 1145843005: Revert "Remove FX_Alloc() null checks now that it can't return NULL." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 7 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/fxge/agg/agg23/fx_agg_path_storage.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 1
2 //---------------------------------------------------------------------------- 2 //----------------------------------------------------------------------------
3 // XYQ: 2006-01-22 Copied from AGG project. 3 // XYQ: 2006-01-22 Copied from AGG project.
4 // This file uses only integer data, so it's suitable for all platforms. 4 // This file uses only integer data, so it's suitable for all platforms.
5 //---------------------------------------------------------------------------- 5 //----------------------------------------------------------------------------
6 //---------------------------------------------------------------------------- 6 //----------------------------------------------------------------------------
7 // Anti-Grain Geometry - Version 2.3 7 // Anti-Grain Geometry - Version 2.3
8 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) 8 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
9 // 9 //
10 // Permission to copy, use, modify, sell and distribute this software 10 // Permission to copy, use, modify, sell and distribute this software
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 m_min_x = 0x7FFFFFFF; 110 m_min_x = 0x7FFFFFFF;
111 m_min_y = 0x7FFFFFFF; 111 m_min_y = 0x7FFFFFFF;
112 m_max_x = -0x7FFFFFFF; 112 m_max_x = -0x7FFFFFFF;
113 m_max_y = -0x7FFFFFFF; 113 m_max_y = -0x7FFFFFFF;
114 } 114 }
115 void outline_aa::allocate_block() 115 void outline_aa::allocate_block()
116 { 116 {
117 if(m_cur_block >= m_num_blocks) { 117 if(m_cur_block >= m_num_blocks) {
118 if(m_num_blocks >= m_max_blocks) { 118 if(m_num_blocks >= m_max_blocks) {
119 cell_aa** new_cells = FX_Alloc( cell_aa*, m_max_blocks + cell_block_ pool); 119 cell_aa** new_cells = FX_Alloc( cell_aa*, m_max_blocks + cell_block_ pool);
120 if (!new_cells) {
121 return;
122 }
120 if(m_cells) { 123 if(m_cells) {
121 FXSYS_memcpy32(new_cells, m_cells, m_max_blocks * sizeof(cell_aa *)); 124 FXSYS_memcpy32(new_cells, m_cells, m_max_blocks * sizeof(cell_aa *));
122 FX_Free(m_cells); 125 FX_Free(m_cells);
123 } 126 }
124 m_cells = new_cells; 127 m_cells = new_cells;
125 m_max_blocks += cell_block_pool; 128 m_max_blocks += cell_block_pool;
126 } 129 }
127 m_cells[m_num_blocks++] = FX_Alloc(cell_aa, cell_block_size); 130 m_cells[m_num_blocks++] = FX_Alloc(cell_aa, cell_block_size);
131 if (!m_cells[m_num_blocks - 1]) {
132 return;
133 }
128 } 134 }
129 m_cur_cell_ptr = m_cells[m_cur_block++]; 135 m_cur_cell_ptr = m_cells[m_cur_block++];
130 } 136 }
131 AGG_INLINE void outline_aa::add_cur_cell() 137 AGG_INLINE void outline_aa::add_cur_cell()
132 { 138 {
133 if(m_cur_cell.area | m_cur_cell.cover) { 139 if(m_cur_cell.area | m_cur_cell.cover) {
134 if((m_num_cells & cell_block_mask) == 0) { 140 if((m_num_cells & cell_block_mask) == 0) {
135 if(m_num_blocks >= cell_block_limit) { 141 if(m_num_blocks >= cell_block_limit) {
136 return; 142 return;
137 } 143 }
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 } 486 }
481 for(i = 0; i < m_sorted_y.size(); i++) { 487 for(i = 0; i < m_sorted_y.size(); i++) {
482 const sorted_y& cur_y = m_sorted_y[i]; 488 const sorted_y& cur_y = m_sorted_y[i];
483 if(cur_y.num) { 489 if(cur_y.num) {
484 qsort_cells(m_sorted_cells.data() + cur_y.start, cur_y.num); 490 qsort_cells(m_sorted_cells.data() + cur_y.start, cur_y.num);
485 } 491 }
486 } 492 }
487 m_sorted = true; 493 m_sorted = true;
488 } 494 }
489 } 495 }
OLDNEW
« no previous file with comments | « core/src/fxge/agg/agg23/fx_agg_path_storage.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