| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "base/trace_event/trace_event.h" | 19 #include "base/trace_event/trace_event.h" |
| 20 #include "cc/base/container_util.h" |
| 20 #include "cc/base/math_util.h" | 21 #include "cc/base/math_util.h" |
| 21 #include "cc/output/compositor_frame.h" | 22 #include "cc/output/compositor_frame.h" |
| 22 #include "cc/output/compositor_frame_metadata.h" | 23 #include "cc/output/compositor_frame_metadata.h" |
| 23 #include "cc/output/context_provider.h" | 24 #include "cc/output/context_provider.h" |
| 24 #include "cc/output/copy_output_request.h" | 25 #include "cc/output/copy_output_request.h" |
| 25 #include "cc/output/dynamic_geometry_binding.h" | 26 #include "cc/output/dynamic_geometry_binding.h" |
| 26 #include "cc/output/gl_frame_data.h" | 27 #include "cc/output/gl_frame_data.h" |
| 27 #include "cc/output/layer_quad.h" | 28 #include "cc/output/layer_quad.h" |
| 28 #include "cc/output/output_surface.h" | 29 #include "cc/output/output_surface.h" |
| 29 #include "cc/output/render_surface_filters.h" | 30 #include "cc/output/render_surface_filters.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 LOG(ERROR) << "Reached limit of pending sync queries."; | 468 LOG(ERROR) << "Reached limit of pending sync queries."; |
| 468 | 469 |
| 469 pending_sync_queries_.front()->Wait(); | 470 pending_sync_queries_.front()->Wait(); |
| 470 DCHECK(!pending_sync_queries_.front()->IsPending()); | 471 DCHECK(!pending_sync_queries_.front()->IsPending()); |
| 471 } | 472 } |
| 472 | 473 |
| 473 while (!pending_sync_queries_.empty()) { | 474 while (!pending_sync_queries_.empty()) { |
| 474 if (pending_sync_queries_.front()->IsPending()) | 475 if (pending_sync_queries_.front()->IsPending()) |
| 475 break; | 476 break; |
| 476 | 477 |
| 477 available_sync_queries_.push_back(pending_sync_queries_.take_front()); | 478 available_sync_queries_.push_back(PopFront(&pending_sync_queries_)); |
| 478 } | 479 } |
| 479 | 480 |
| 480 current_sync_query_ = available_sync_queries_.empty() | 481 current_sync_query_ = available_sync_queries_.empty() |
| 481 ? make_scoped_ptr(new SyncQuery(gl_)) | 482 ? make_scoped_ptr(new SyncQuery(gl_)) |
| 482 : available_sync_queries_.take_front(); | 483 : PopFront(&available_sync_queries_); |
| 483 | 484 |
| 484 read_lock_fence = current_sync_query_->Begin(); | 485 read_lock_fence = current_sync_query_->Begin(); |
| 485 } else { | 486 } else { |
| 486 read_lock_fence = | 487 read_lock_fence = |
| 487 make_scoped_refptr(new ResourceProvider::SynchronousFence(gl_)); | 488 make_scoped_refptr(new ResourceProvider::SynchronousFence(gl_)); |
| 488 } | 489 } |
| 489 resource_provider_->SetReadLockFence(read_lock_fence.get()); | 490 resource_provider_->SetReadLockFence(read_lock_fence.get()); |
| 490 | 491 |
| 491 // Insert WaitSyncTokenCHROMIUM on quad resources prior to drawing the frame, | 492 // Insert WaitSyncTokenCHROMIUM on quad resources prior to drawing the frame, |
| 492 // so that drawing can proceed without GL context switching interruptions. | 493 // so that drawing can proceed without GL context switching interruptions. |
| (...skipping 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3543 texture_id = pending_overlay_resources_.back()->texture_id(); | 3544 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3544 } | 3545 } |
| 3545 | 3546 |
| 3546 context_support_->ScheduleOverlayPlane( | 3547 context_support_->ScheduleOverlayPlane( |
| 3547 overlay.plane_z_order, overlay.transform, texture_id, | 3548 overlay.plane_z_order, overlay.transform, texture_id, |
| 3548 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3549 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3549 } | 3550 } |
| 3550 } | 3551 } |
| 3551 | 3552 |
| 3552 } // namespace cc | 3553 } // namespace cc |
| OLD | NEW |