| 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_resource.h" |
| 11 #include "cc/proxy.h" | 11 #include "cc/proxy.h" |
| 12 #include "cc/resource_provider.h" | 12 #include "cc/resource_provider.h" |
| 13 #include "cc/texture_copier.h" | 13 #include "cc/texture_copier.h" |
| 14 #include "cc/thread.h" | 14 #include "cc/thread.h" |
| 15 #include "third_party/khronos/GLES2/gl2.h" | 15 #include "third_party/khronos/GLES2/gl2.h" |
| 16 #include "third_party/skia/include/gpu/SkGpuDevice.h" | 16 #include "third_party/skia/include/gpu/SkGpuDevice.h" |
| 17 #include <limits> | 17 #include <limits> |
| 18 #include <public/WebGraphicsContext3D.h> | 18 #include <public/WebGraphicsContext3D.h> |
| 19 #include <public/WebSharedGraphicsContext3D.h> | 19 #include <public/WebSharedGraphicsContext3D.h> |
| 20 | 20 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 void ResourceUpdateController::discardUploadsToEvictedResources() | 113 void ResourceUpdateController::discardUploadsToEvictedResources() |
| 114 { | 114 { |
| 115 m_queue->clearUploadsToEvictedResources(); | 115 m_queue->clearUploadsToEvictedResources(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void ResourceUpdateController::updateTexture(ResourceUpdate update) | 118 void ResourceUpdateController::updateTexture(ResourceUpdate update) |
| 119 { | 119 { |
| 120 if (update.picture) { | 120 if (update.picture) { |
| 121 PrioritizedTexture* texture = update.texture; | 121 PrioritizedResource* texture = update.texture; |
| 122 gfx::Rect pictureRect = update.content_rect; | 122 gfx::Rect pictureRect = update.content_rect; |
| 123 gfx::Rect sourceRect = update.source_rect; | 123 gfx::Rect sourceRect = update.source_rect; |
| 124 gfx::Vector2d destOffset = update.dest_offset; | 124 gfx::Vector2d destOffset = update.dest_offset; |
| 125 | 125 |
| 126 texture->acquireBackingTexture(m_resourceProvider); | 126 texture->acquireBackingTexture(m_resourceProvider); |
| 127 DCHECK(texture->haveBackingTexture()); | 127 DCHECK(texture->haveBackingTexture()); |
| 128 | 128 |
| 129 DCHECK(m_resourceProvider->resourceType(texture->resourceId()) == | 129 DCHECK(m_resourceProvider->resourceType(texture->resourceId()) == |
| 130 ResourceProvider::GLTexture); | 130 ResourceProvider::GLTexture); |
| 131 | 131 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 if (!uploads) | 284 if (!uploads) |
| 285 return; | 285 return; |
| 286 | 286 |
| 287 while (m_queue->fullUploadSize() && uploads--) | 287 while (m_queue->fullUploadSize() && uploads--) |
| 288 updateTexture(m_queue->takeFirstFullUpload()); | 288 updateTexture(m_queue->takeFirstFullUpload()); |
| 289 | 289 |
| 290 m_resourceProvider->flushUploads(); | 290 m_resourceProvider->flushUploads(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace cc | 293 } // namespace cc |
| OLD | NEW |