| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium 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 #include "cc/scheduler/texture_uploader.h" | 5 #include "cc/scheduler/texture_uploader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 bool is_full_upload = dest_offset.IsZero() && source_rect.size() == size; | 141 bool is_full_upload = dest_offset.IsZero() && source_rect.size() == size; |
| 142 | 142 |
| 143 if (is_full_upload) | 143 if (is_full_upload) |
| 144 BeginQuery(); | 144 BeginQuery(); |
| 145 | 145 |
| 146 if (format == ETC1) { | 146 if (format == ETC1) { |
| 147 // ETC1 does not support subimage uploads. | 147 // ETC1 does not support subimage uploads. |
| 148 DCHECK(is_full_upload); | 148 DCHECK(is_full_upload); |
| 149 UploadWithTexImageETC1(image, size); | 149 UploadWithTexImageETC1(image, size); |
| 150 return; | |
| 151 } | |
| 152 | |
| 153 if (use_map_tex_sub_image_) { | |
| 154 UploadWithMapTexSubImage( | |
| 155 image, image_rect, source_rect, dest_offset, format); | |
| 156 } else { | 150 } else { |
| 157 UploadWithTexSubImage(image, image_rect, source_rect, dest_offset, format); | 151 if (use_map_tex_sub_image_) { |
| 152 UploadWithMapTexSubImage( |
| 153 image, image_rect, source_rect, dest_offset, format); |
| 154 } else { |
| 155 UploadWithTexSubImage( |
| 156 image, image_rect, source_rect, dest_offset, format); |
| 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 if (is_full_upload) | 160 if (is_full_upload) |
| 161 EndQuery(); | 161 EndQuery(); |
| 162 | 162 |
| 163 num_texture_uploads_since_last_flush_++; | 163 num_texture_uploads_since_last_flush_++; |
| 164 if (num_texture_uploads_since_last_flush_ >= kTextureUploadFlushPeriod) | 164 if (num_texture_uploads_since_last_flush_ >= kTextureUploadFlushPeriod) |
| 165 Flush(); | 165 Flush(); |
| 166 } | 166 } |
| 167 | 167 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 textures_per_second_history_.erase(textures_per_second_history_.begin()); | 332 textures_per_second_history_.erase(textures_per_second_history_.begin()); |
| 333 textures_per_second_history_.erase(--textures_per_second_history_.end()); | 333 textures_per_second_history_.erase(--textures_per_second_history_.end()); |
| 334 } | 334 } |
| 335 textures_per_second_history_.insert(textures_per_second); | 335 textures_per_second_history_.insert(textures_per_second); |
| 336 | 336 |
| 337 available_queries_.push_back(pending_queries_.take_front()); | 337 available_queries_.push_back(pending_queries_.take_front()); |
| 338 } | 338 } |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace cc | 341 } // namespace cc |
| OLD | NEW |