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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |