diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-14 14:43:42 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 19:05:58 +0000 |
commit | 05df075154a832fcb476e1dfcfb865722d0ea898 (patch) | |
tree | b8b771b62adae74d5d5ee561db75d10de3a848bf /third_party/agg23/agg_path_storage.h | |
parent | 6b94f01d1c8ad386d497428c7397b1a99614aeba (diff) | |
download | pdfium-05df075154a832fcb476e1dfcfb865722d0ea898.tar.xz |
Replace FX_FLOAT with underlying float type.
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56
Reviewed-on: https://pdfium-review.googlesource.com/3031
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'third_party/agg23/agg_path_storage.h')
-rw-r--r-- | third_party/agg23/agg_path_storage.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/third_party/agg23/agg_path_storage.h b/third_party/agg23/agg_path_storage.h index 7f21bacd09..17e82d73e4 100644 --- a/third_party/agg23/agg_path_storage.h +++ b/third_party/agg23/agg_path_storage.h @@ -36,7 +36,7 @@ public: { m_vertex_idx = path_id; } - unsigned vertex(FX_FLOAT* x, FX_FLOAT* y) + unsigned vertex(float* x, float* y) { return (m_vertex_idx < m_path->total_vertices()) ? m_path->vertex(m_vertex_idx++, x, y) @@ -48,19 +48,19 @@ public: }; ~path_storage(); path_storage(); - unsigned last_vertex(FX_FLOAT* x, FX_FLOAT* y) const; - unsigned prev_vertex(FX_FLOAT* x, FX_FLOAT* y) const; - void move_to(FX_FLOAT x, FX_FLOAT y); - void line_to(FX_FLOAT x, FX_FLOAT y); - void curve4(FX_FLOAT x_ctrl1, FX_FLOAT y_ctrl1, - FX_FLOAT x_ctrl2, FX_FLOAT y_ctrl2, - FX_FLOAT x_to, FX_FLOAT y_to); + unsigned last_vertex(float* x, float* y) const; + unsigned prev_vertex(float* x, float* y) const; + void move_to(float x, float y); + void line_to(float x, float y); + void curve4(float x_ctrl1, float y_ctrl1, + float x_ctrl2, float y_ctrl2, + float x_to, float y_to); template<class VertexSource> void add_path(VertexSource& vs, unsigned path_id = 0, bool solid_path = true) { - FX_FLOAT x, y; + float x, y; unsigned cmd; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { @@ -75,7 +75,7 @@ public: unsigned path_id = 0, bool solid_path = true) { - FX_FLOAT x, y; + float x, y; unsigned cmd; int flag; vs.rewind(path_id); @@ -90,10 +90,10 @@ public: { return m_total_vertices; } - unsigned vertex(unsigned idx, FX_FLOAT* x, FX_FLOAT* y) const + unsigned vertex(unsigned idx, float* x, float* y) const { unsigned nb = idx >> block_shift; - const FX_FLOAT* pv = m_coord_blocks[nb] + ((idx & block_mask) << 1); + const float* pv = m_coord_blocks[nb] + ((idx & block_mask) << 1); *x = *pv++; *y = *pv; return m_cmd_blocks[nb][idx & block_mask]; @@ -107,42 +107,42 @@ public: return m_cmd_blocks[idx >> block_shift][idx & block_mask] & path_flags_jr; } void rewind(unsigned path_id); - unsigned vertex(FX_FLOAT* x, FX_FLOAT* y); - void add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd); + unsigned vertex(float* x, float* y); + void add_vertex(float x, float y, unsigned cmd); void end_poly(); private: void allocate_block(unsigned nb); - unsigned char* storage_ptrs(FX_FLOAT** xy_ptr); + unsigned char* storage_ptrs(float** xy_ptr); private: unsigned m_total_vertices; unsigned m_total_blocks; unsigned m_max_blocks; - FX_FLOAT** m_coord_blocks; + float** m_coord_blocks; unsigned char** m_cmd_blocks; unsigned m_iterator; }; -inline unsigned path_storage::vertex(FX_FLOAT* x, FX_FLOAT* y) +inline unsigned path_storage::vertex(float* x, float* y) { if(m_iterator >= m_total_vertices) { return path_cmd_stop; } return vertex(m_iterator++, x, y); } -inline unsigned path_storage::prev_vertex(FX_FLOAT* x, FX_FLOAT* y) const +inline unsigned path_storage::prev_vertex(float* x, float* y) const { if(m_total_vertices > 1) { return vertex(m_total_vertices - 2, x, y); } return path_cmd_stop; } -inline unsigned path_storage::last_vertex(FX_FLOAT* x, FX_FLOAT* y) const +inline unsigned path_storage::last_vertex(float* x, float* y) const { if(m_total_vertices) { return vertex(m_total_vertices - 1, x, y); } return path_cmd_stop; } -inline unsigned char* path_storage::storage_ptrs(FX_FLOAT** xy_ptr) +inline unsigned char* path_storage::storage_ptrs(float** xy_ptr) { unsigned nb = m_total_vertices >> block_shift; if(nb >= m_total_blocks) { @@ -151,20 +151,20 @@ inline unsigned char* path_storage::storage_ptrs(FX_FLOAT** xy_ptr) *xy_ptr = m_coord_blocks[nb] + ((m_total_vertices & block_mask) << 1); return m_cmd_blocks[nb] + (m_total_vertices & block_mask); } -inline void path_storage::add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd) +inline void path_storage::add_vertex(float x, float y, unsigned cmd) { - FX_FLOAT* coord_ptr = 0; + float* coord_ptr = 0; unsigned char* cmd_ptr = storage_ptrs(&coord_ptr); *cmd_ptr = (unsigned char)cmd; *coord_ptr++ = x; *coord_ptr = y; m_total_vertices++; } -inline void path_storage::move_to(FX_FLOAT x, FX_FLOAT y) +inline void path_storage::move_to(float x, float y) { add_vertex(x, y, path_cmd_move_to); } -inline void path_storage::line_to(FX_FLOAT x, FX_FLOAT y) +inline void path_storage::line_to(float x, float y) { add_vertex(x, y, path_cmd_line_to); } |