| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/raster/one_copy_tile_task_worker_pool.h" | 5 #include "cc/raster/one_copy_tile_task_worker_pool.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "cc/base/math_util.h" | 14 #include "cc/base/math_util.h" |
| 15 #include "cc/raster/raster_buffer.h" | |
| 16 #include "cc/raster/staging_buffer_pool.h" | 15 #include "cc/raster/staging_buffer_pool.h" |
| 17 #include "cc/resources/platform_color.h" | 16 #include "cc/resources/platform_color.h" |
| 18 #include "cc/resources/resource_format.h" | 17 #include "cc/resources/resource_format.h" |
| 19 #include "cc/resources/resource_util.h" | 18 #include "cc/resources/resource_util.h" |
| 20 #include "cc/resources/scoped_resource.h" | 19 #include "cc/resources/scoped_resource.h" |
| 21 #include "gpu/GLES2/gl2extchromium.h" | 20 #include "gpu/GLES2/gl2extchromium.h" |
| 22 #include "gpu/command_buffer/client/gles2_interface.h" | 21 #include "gpu/command_buffer/client/gles2_interface.h" |
| 23 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 22 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| 24 #include "ui/gfx/buffer_format_util.h" | 23 #include "ui/gfx/buffer_format_util.h" |
| 25 | 24 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 164 } |
| 166 | 165 |
| 167 return resource_provider_->best_texture_format(); | 166 return resource_provider_->best_texture_format(); |
| 168 } | 167 } |
| 169 | 168 |
| 170 bool OneCopyTileTaskWorkerPool::GetResourceRequiresSwizzle( | 169 bool OneCopyTileTaskWorkerPool::GetResourceRequiresSwizzle( |
| 171 bool must_support_alpha) const { | 170 bool must_support_alpha) const { |
| 172 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); | 171 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); |
| 173 } | 172 } |
| 174 | 173 |
| 174 RasterBufferProvider* OneCopyTileTaskWorkerPool::AsRasterBufferProvider() { |
| 175 return this; |
| 176 } |
| 177 |
| 175 std::unique_ptr<RasterBuffer> OneCopyTileTaskWorkerPool::AcquireBufferForRaster( | 178 std::unique_ptr<RasterBuffer> OneCopyTileTaskWorkerPool::AcquireBufferForRaster( |
| 176 const Resource* resource, | 179 const Resource* resource, |
| 177 uint64_t resource_content_id, | 180 uint64_t resource_content_id, |
| 178 uint64_t previous_content_id) { | 181 uint64_t previous_content_id) { |
| 179 // TODO(danakj): If resource_content_id != 0, we only need to copy/upload | 182 // TODO(danakj): If resource_content_id != 0, we only need to copy/upload |
| 180 // the dirty rect. | 183 // the dirty rect. |
| 181 return base::WrapUnique<RasterBuffer>( | 184 return base::WrapUnique<RasterBuffer>( |
| 182 new RasterBufferImpl(this, resource_provider_, resource->format(), | 185 new RasterBufferImpl(this, resource_provider_, resource->format(), |
| 183 resource, previous_content_id)); | 186 resource, previous_content_id)); |
| 184 } | 187 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 gl->OrderingBarrierCHROMIUM(); | 379 gl->OrderingBarrierCHROMIUM(); |
| 377 | 380 |
| 378 // Generate sync token after the barrier for cross context synchronization. | 381 // Generate sync token after the barrier for cross context synchronization. |
| 379 gpu::SyncToken sync_token; | 382 gpu::SyncToken sync_token; |
| 380 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); | 383 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); |
| 381 resource_lock->UpdateResourceSyncToken(sync_token); | 384 resource_lock->UpdateResourceSyncToken(sync_token); |
| 382 } | 385 } |
| 383 } | 386 } |
| 384 | 387 |
| 385 } // namespace cc | 388 } // namespace cc |
| OLD | NEW |