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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/resource_update_controller.h" | 7 #include "cc/resource_update_controller.h" |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/prioritized_texture.h" | 10 #include "cc/prioritized_texture.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // texture. | 174 // texture. |
175 paintGrContext->flush(); | 175 paintGrContext->flush(); |
176 | 176 |
177 // Flush the GL context so rendering results from this context are | 177 // Flush the GL context so rendering results from this context are |
178 // visible in the compositor's context. | 178 // visible in the compositor's context. |
179 paintContext->flush(); | 179 paintContext->flush(); |
180 } | 180 } |
181 | 181 |
182 if (update.bitmap) { | 182 if (update.bitmap) { |
183 update.bitmap->lockPixels(); | 183 update.bitmap->lockPixels(); |
184 update.texture->upload( | 184 update.texture->setPixels( |
185 m_resourceProvider, | 185 m_resourceProvider, |
186 static_cast<const uint8_t*>(update.bitmap->getPixels()), | 186 static_cast<const uint8_t*>(update.bitmap->getPixels()), |
187 update.content_rect, | 187 update.content_rect, |
188 update.source_rect, | 188 update.source_rect, |
189 update.dest_offset); | 189 update.dest_offset); |
190 update.bitmap->unlockPixels(); | 190 update.bitmap->unlockPixels(); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 void ResourceUpdateController::finalize() | 194 void ResourceUpdateController::finalize() |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 while (m_queue->fullUploadSize() && uploadCount < uploads) { | 295 while (m_queue->fullUploadSize() && uploadCount < uploads) { |
296 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount) | 296 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount) |
297 m_resourceProvider->shallowFlushIfSupported(); | 297 m_resourceProvider->shallowFlushIfSupported(); |
298 updateTexture(m_queue->takeFirstFullUpload()); | 298 updateTexture(m_queue->takeFirstFullUpload()); |
299 uploadCount++; | 299 uploadCount++; |
300 } | 300 } |
301 m_resourceProvider->shallowFlushIfSupported(); | 301 m_resourceProvider->shallowFlushIfSupported(); |
302 } | 302 } |
303 | 303 |
304 } // namespace cc | 304 } // namespace cc |
OLD | NEW |