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

Side by Side Diff: cc/texture_uploader.cc

Issue 12284013: Shrink texture uploader when not visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « cc/texture_uploader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/texture_uploader.h" 5 #include "cc/texture_uploader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 void TextureUploader::flush() { 189 void TextureUploader::flush() {
190 if (!m_numTextureUploadsSinceLastFlush) 190 if (!m_numTextureUploadsSinceLastFlush)
191 return; 191 return;
192 192
193 if (m_useShallowFlush) 193 if (m_useShallowFlush)
194 m_context->shallowFlushCHROMIUM(); 194 m_context->shallowFlushCHROMIUM();
195 195
196 m_numTextureUploadsSinceLastFlush = 0; 196 m_numTextureUploadsSinceLastFlush = 0;
197 } 197 }
198 198
199 void TextureUploader::releaseCachedQueries()
200 {
201 processQueries();
202 m_availableQueries.clear();
203 }
204
199 void TextureUploader::uploadWithTexSubImage(const uint8* image, 205 void TextureUploader::uploadWithTexSubImage(const uint8* image,
200 const gfx::Rect& image_rect, 206 const gfx::Rect& image_rect,
201 const gfx::Rect& source_rect, 207 const gfx::Rect& source_rect,
202 const gfx::Vector2d& dest_offset, 208 const gfx::Vector2d& dest_offset,
203 GLenum format) 209 GLenum format)
204 { 210 {
205 // Instrumentation to debug issue 156107 211 // Instrumentation to debug issue 156107
206 int source_rect_x = source_rect.x(); 212 int source_rect_x = source_rect.x();
207 int source_rect_y = source_rect.y(); 213 int source_rect_y = source_rect.y();
208 int source_rect_width = source_rect.width(); 214 int source_rect_width = source_rect.width();
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 m_texturesPerSecondHistory.erase(m_texturesPerSecondHistory.begin()) ; 370 m_texturesPerSecondHistory.erase(m_texturesPerSecondHistory.begin()) ;
365 m_texturesPerSecondHistory.erase(--m_texturesPerSecondHistory.end()) ; 371 m_texturesPerSecondHistory.erase(--m_texturesPerSecondHistory.end()) ;
366 } 372 }
367 m_texturesPerSecondHistory.insert(texturesPerSecond); 373 m_texturesPerSecondHistory.insert(texturesPerSecond);
368 374
369 m_availableQueries.push_back(m_pendingQueries.take_front()); 375 m_availableQueries.push_back(m_pendingQueries.take_front());
370 } 376 }
371 } 377 }
372 378
373 } // namespace cc 379 } // namespace cc
OLDNEW
« no previous file with comments | « cc/texture_uploader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698