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

Side by Side Diff: cc/scheduler/texture_uploader.cc

Issue 41903003: cc: Fix incomplete changes to add ETC1 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased and moved pixel ref class to public cc Created 7 years, 1 month 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698