| 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 "CCTextureUpdateController.h" | 7 #include "CCTextureUpdateController.h" |
| 8 | 8 |
| 9 #include "CCResourceProvider.h" | 9 #include "CCResourceProvider.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 void CCTextureUpdateController::updateTexture(ResourceUpdate update) | 115 void CCTextureUpdateController::updateTexture(ResourceUpdate update) |
| 116 { | 116 { |
| 117 if (update.picture) { | 117 if (update.picture) { |
| 118 CCPrioritizedTexture* texture = update.texture; | 118 CCPrioritizedTexture* texture = update.texture; |
| 119 IntRect pictureRect = update.content_rect; | 119 IntRect pictureRect = update.content_rect; |
| 120 IntRect sourceRect = update.source_rect; | 120 IntRect sourceRect = update.source_rect; |
| 121 IntSize destOffset = update.dest_offset; | 121 IntSize destOffset = update.dest_offset; |
| 122 | 122 |
| 123 texture->acquireBackingTexture(m_resourceProvider); | 123 texture->acquireBackingTexture(m_resourceProvider); |
| 124 ASSERT(texture->haveBackingTexture()); | 124 DCHECK(texture->haveBackingTexture()); |
| 125 | 125 |
| 126 ASSERT(m_resourceProvider->resourceType(texture->resourceId()) == | 126 DCHECK(m_resourceProvider->resourceType(texture->resourceId()) == |
| 127 CCResourceProvider::GLTexture); | 127 CCResourceProvider::GLTexture); |
| 128 | 128 |
| 129 WebGraphicsContext3D* paintContext = CCProxy::hasImplThread() ? | 129 WebGraphicsContext3D* paintContext = CCProxy::hasImplThread() ? |
| 130 WebSharedGraphicsContext3D::compositorThreadContext() : | 130 WebSharedGraphicsContext3D::compositorThreadContext() : |
| 131 WebSharedGraphicsContext3D::mainThreadContext(); | 131 WebSharedGraphicsContext3D::mainThreadContext(); |
| 132 GrContext* paintGrContext = CCProxy::hasImplThread() ? | 132 GrContext* paintGrContext = CCProxy::hasImplThread() ? |
| 133 WebSharedGraphicsContext3D::compositorThreadGrContext() : | 133 WebSharedGraphicsContext3D::compositorThreadGrContext() : |
| 134 WebSharedGraphicsContext3D::mainThreadGrContext(); | 134 WebSharedGraphicsContext3D::mainThreadGrContext(); |
| 135 | 135 |
| 136 // Flush the context in which the backing texture is created so that it | 136 // Flush the context in which the backing texture is created so that it |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 while (m_queue->fullUploadSize() && uploadCount < uploads) { | 281 while (m_queue->fullUploadSize() && uploadCount < uploads) { |
| 282 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount) | 282 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount) |
| 283 m_resourceProvider->shallowFlushIfSupported(); | 283 m_resourceProvider->shallowFlushIfSupported(); |
| 284 updateTexture(m_queue->takeFirstFullUpload()); | 284 updateTexture(m_queue->takeFirstFullUpload()); |
| 285 uploadCount++; | 285 uploadCount++; |
| 286 } | 286 } |
| 287 m_resourceProvider->shallowFlushIfSupported(); | 287 m_resourceProvider->shallowFlushIfSupported(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 } // namespace cc | 290 } // namespace cc |
| OLD | NEW |