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

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

Issue 1221433002: cc: narrow ChromeOS perf workaround to ARM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: narrow ChromeOS perf workaround to ARM 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
« no previous file with comments | « no previous file | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 gl->BindTexImage2DCHROMIUM(image_target, staging_buffer->image_id); 413 gl->BindTexImage2DCHROMIUM(image_target, staging_buffer->image_id);
414 } 414 }
415 415
416 // Unbind staging texture. 416 // Unbind staging texture.
417 gl->BindTexture(image_target, 0); 417 gl->BindTexture(image_target, 0);
418 418
419 if (resource_provider_->use_sync_query()) { 419 if (resource_provider_->use_sync_query()) {
420 if (!staging_buffer->query_id) 420 if (!staging_buffer->query_id)
421 gl->GenQueriesEXT(1, &staging_buffer->query_id); 421 gl->GenQueriesEXT(1, &staging_buffer->query_id);
422 422
423 #if defined(OS_CHROMEOS) 423 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
424 // TODO(reveman): This avoids a performance problem on some ChromeOS 424 // TODO(reveman): This avoids a performance problem on ARM ChromeOS
425 // devices. This needs to be removed to support native GpuMemoryBuffer 425 // devices. crbug.com/580166
426 // implementations. crbug.com/436314
427 gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, staging_buffer->query_id); 426 gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, staging_buffer->query_id);
428 #else 427 #else
429 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, 428 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM,
430 staging_buffer->query_id); 429 staging_buffer->query_id);
431 #endif 430 #endif
432 } 431 }
433 432
434 int bytes_per_row = 433 int bytes_per_row =
435 (BitsPerPixel(resource->format()) * resource->size().width()) / 8; 434 (BitsPerPixel(resource->format()) * resource->size().width()) / 8;
436 int chunk_size_in_rows = 435 int chunk_size_in_rows =
(...skipping 16 matching lines...) Expand all
453 // used for this copy operation. 452 // used for this copy operation.
454 bytes_scheduled_since_last_flush_ += rows_to_copy * bytes_per_row; 453 bytes_scheduled_since_last_flush_ += rows_to_copy * bytes_per_row;
455 454
456 if (bytes_scheduled_since_last_flush_ >= max_bytes_per_copy_operation_) { 455 if (bytes_scheduled_since_last_flush_ >= max_bytes_per_copy_operation_) {
457 gl->ShallowFlushCHROMIUM(); 456 gl->ShallowFlushCHROMIUM();
458 bytes_scheduled_since_last_flush_ = 0; 457 bytes_scheduled_since_last_flush_ = 0;
459 } 458 }
460 } 459 }
461 460
462 if (resource_provider_->use_sync_query()) { 461 if (resource_provider_->use_sync_query()) {
463 #if defined(OS_CHROMEOS) 462 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
464 gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); 463 gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM);
465 #else 464 #else
466 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM); 465 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM);
467 #endif 466 #endif
468 } 467 }
469 468
470 // Barrier to sync worker context output to cc context. 469 // Barrier to sync worker context output to cc context.
471 gl->OrderingBarrierCHROMIUM(); 470 gl->OrderingBarrierCHROMIUM();
472 } 471 }
473 472
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 return; 721 return;
723 722
724 busy_buffers_.front()->DestroyGLResources(gl); 723 busy_buffers_.front()->DestroyGLResources(gl);
725 RemoveStagingBuffer(busy_buffers_.front().get()); 724 RemoveStagingBuffer(busy_buffers_.front().get());
726 busy_buffers_.pop_front(); 725 busy_buffers_.pop_front();
727 } 726 }
728 } 727 }
729 } 728 }
730 729
731 } // namespace cc 730 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698