Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: cc/raster/one_copy_tile_task_worker_pool.cc

Issue 1551143002: Remove the "target" argument from CopyTextureChromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 std::max(1, max_bytes_per_copy_operation_ / bytes_per_row); 437 std::max(1, max_bytes_per_copy_operation_ / bytes_per_row);
438 // Align chunk size to 4. Required to support compressed texture formats. 438 // Align chunk size to 4. Required to support compressed texture formats.
439 chunk_size_in_rows = MathUtil::UncheckedRoundUp(chunk_size_in_rows, 4); 439 chunk_size_in_rows = MathUtil::UncheckedRoundUp(chunk_size_in_rows, 4);
440 int y = 0; 440 int y = 0;
441 int height = resource->size().height(); 441 int height = resource->size().height();
442 while (y < height) { 442 while (y < height) {
443 // Copy at most |chunk_size_in_rows|. 443 // Copy at most |chunk_size_in_rows|.
444 int rows_to_copy = std::min(chunk_size_in_rows, height - y); 444 int rows_to_copy = std::min(chunk_size_in_rows, height - y);
445 DCHECK_GT(rows_to_copy, 0); 445 DCHECK_GT(rows_to_copy, 0);
446 446
447 gl->CopySubTextureCHROMIUM(GL_TEXTURE_2D, staging_buffer->texture_id, 447 gl->CopySubTextureCHROMIUM(staging_buffer->texture_id,
448 resource_lock->texture_id(), 0, y, 0, y, 448 resource_lock->texture_id(), 0, y, 0, y,
449 resource->size().width(), rows_to_copy, false, 449 resource->size().width(), rows_to_copy, false,
450 false, false); 450 false, false);
451 y += rows_to_copy; 451 y += rows_to_copy;
452 452
453 // Increment |bytes_scheduled_since_last_flush_| by the amount of memory 453 // Increment |bytes_scheduled_since_last_flush_| by the amount of memory
454 // used for this copy operation. 454 // used for this copy operation.
455 bytes_scheduled_since_last_flush_ += rows_to_copy * bytes_per_row; 455 bytes_scheduled_since_last_flush_ += rows_to_copy * bytes_per_row;
456 456
457 if (bytes_scheduled_since_last_flush_ >= max_bytes_per_copy_operation_) { 457 if (bytes_scheduled_since_last_flush_ >= max_bytes_per_copy_operation_) {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 return; 723 return;
724 724
725 busy_buffers_.front()->DestroyGLResources(gl); 725 busy_buffers_.front()->DestroyGLResources(gl);
726 RemoveStagingBuffer(busy_buffers_.front().get()); 726 RemoveStagingBuffer(busy_buffers_.front().get());
727 busy_buffers_.pop_front(); 727 busy_buffers_.pop_front();
728 } 728 }
729 } 729 }
730 } 730 }
731 731
732 } // namespace cc 732 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698