| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 need_to_render_(true), | 120 need_to_render_(true), |
| 121 rendering_(false), | 121 rendering_(false), |
| 122 drawing_(false), | 122 drawing_(false), |
| 123 width_(0), | 123 width_(0), |
| 124 height_(0), | 124 height_(0), |
| 125 display_width_(0), | 125 display_width_(0), |
| 126 display_height_(0), | 126 display_height_(0), |
| 127 dest_x_offset_(0), | 127 dest_x_offset_(0), |
| 128 dest_y_offset_(0), | 128 dest_y_offset_(0), |
| 129 supports_npot_(false), | 129 supports_npot_(false), |
| 130 back_buffer_cleared_(false) { | 130 back_buffer_cleared_(false), |
| 131 presented_once_(false) { |
| 131 } | 132 } |
| 132 | 133 |
| 133 Renderer::~Renderer() { | 134 Renderer::~Renderer() { |
| 134 // Delete all the state handlers. | 135 // Delete all the state handlers. |
| 135 while (!state_handler_map_.empty()) { | 136 while (!state_handler_map_.empty()) { |
| 136 delete state_handler_map_.begin()->second; | 137 delete state_handler_map_.begin()->second; |
| 137 state_handler_map_.erase(state_handler_map_.begin()); | 138 state_handler_map_.erase(state_handler_map_.begin()); |
| 138 } | 139 } |
| 139 } | 140 } |
| 140 | 141 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 current_render_surface_ = NULL; | 315 current_render_surface_ = NULL; |
| 315 current_depth_surface_ = NULL; | 316 current_depth_surface_ = NULL; |
| 316 rendering_ = false; | 317 rendering_ = false; |
| 317 } | 318 } |
| 318 } | 319 } |
| 319 | 320 |
| 320 void Renderer::Present() { | 321 void Renderer::Present() { |
| 321 DCHECK(!rendering_); | 322 DCHECK(!rendering_); |
| 322 DCHECK(!drawing_); | 323 DCHECK(!drawing_); |
| 323 PlatformSpecificPresent(); | 324 PlatformSpecificPresent(); |
| 325 presented_once_ = true; |
| 324 } | 326 } |
| 325 | 327 |
| 326 void Renderer::Clear(const Float4 &color, | 328 void Renderer::Clear(const Float4 &color, |
| 327 bool color_flag, | 329 bool color_flag, |
| 328 float depth, | 330 float depth, |
| 329 bool depth_flag, | 331 bool depth_flag, |
| 330 int stencil, | 332 int stencil, |
| 331 bool stencil_flag) { | 333 bool stencil_flag) { |
| 332 // If we are currently rendering to the backbuffer and it has not been cleared | 334 // If we are currently rendering to the backbuffer and it has not been cleared |
| 333 // AND if we are not about to clear it entirely then clear it. | 335 // AND if we are not about to clear it entirely then clear it. |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 bool Renderer::SafeToBindTexture(Texture* texture) const { | 820 bool Renderer::SafeToBindTexture(Texture* texture) const { |
| 819 if (current_render_surface_ && | 821 if (current_render_surface_ && |
| 820 current_render_surface_->texture() == texture) { | 822 current_render_surface_->texture() == texture) { |
| 821 return false; | 823 return false; |
| 822 } | 824 } |
| 823 | 825 |
| 824 return true; | 826 return true; |
| 825 } | 827 } |
| 826 | 828 |
| 827 } // namespace o3d | 829 } // namespace o3d |
| OLD | NEW |