| 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> |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 use_sync_query_ = context_caps.gpu.sync_query; | 370 use_sync_query_ = context_caps.gpu.sync_query; |
| 371 use_blend_equation_advanced_ = context_caps.gpu.blend_equation_advanced; | 371 use_blend_equation_advanced_ = context_caps.gpu.blend_equation_advanced; |
| 372 use_blend_equation_advanced_coherent_ = | 372 use_blend_equation_advanced_coherent_ = |
| 373 context_caps.gpu.blend_equation_advanced_coherent; | 373 context_caps.gpu.blend_equation_advanced_coherent; |
| 374 | 374 |
| 375 InitializeSharedObjects(); | 375 InitializeSharedObjects(); |
| 376 } | 376 } |
| 377 | 377 |
| 378 GLRenderer::~GLRenderer() { | 378 GLRenderer::~GLRenderer() { |
| 379 while (!pending_async_read_pixels_.empty()) { | 379 while (!pending_async_read_pixels_.empty()) { |
| 380 PendingAsyncReadPixels* pending_read = pending_async_read_pixels_.back(); | 380 PendingAsyncReadPixels* pending_read = |
| 381 pending_async_read_pixels_.back().get(); |
| 381 pending_read->finished_read_pixels_callback.Cancel(); | 382 pending_read->finished_read_pixels_callback.Cancel(); |
| 382 pending_async_read_pixels_.pop_back(); | 383 pending_async_read_pixels_.pop_back(); |
| 383 } | 384 } |
| 384 | 385 |
| 385 previous_swap_overlay_resources_.clear(); | 386 previous_swap_overlay_resources_.clear(); |
| 386 in_use_overlay_resources_.clear(); | 387 in_use_overlay_resources_.clear(); |
| 387 | 388 |
| 388 CleanupSharedObjects(); | 389 CleanupSharedObjects(); |
| 389 } | 390 } |
| 390 | 391 |
| (...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2825 // callbacks to this function are in the same order as we post the copy | 2826 // callbacks to this function are in the same order as we post the copy |
| 2826 // requests. | 2827 // requests. |
| 2827 // Nevertheless, it is very likely that the order is preserved, and thus | 2828 // Nevertheless, it is very likely that the order is preserved, and thus |
| 2828 // start searching from back to the front. | 2829 // start searching from back to the front. |
| 2829 auto iter = pending_async_read_pixels_.rbegin(); | 2830 auto iter = pending_async_read_pixels_.rbegin(); |
| 2830 const auto& reverse_end = pending_async_read_pixels_.rend(); | 2831 const auto& reverse_end = pending_async_read_pixels_.rend(); |
| 2831 while (iter != reverse_end && (*iter)->buffer != source_buffer) | 2832 while (iter != reverse_end && (*iter)->buffer != source_buffer) |
| 2832 ++iter; | 2833 ++iter; |
| 2833 | 2834 |
| 2834 DCHECK(iter != reverse_end); | 2835 DCHECK(iter != reverse_end); |
| 2835 PendingAsyncReadPixels* current_read = *iter; | 2836 PendingAsyncReadPixels* current_read = iter->get(); |
| 2836 | 2837 |
| 2837 uint8* src_pixels = NULL; | 2838 uint8* src_pixels = NULL; |
| 2838 scoped_ptr<SkBitmap> bitmap; | 2839 scoped_ptr<SkBitmap> bitmap; |
| 2839 | 2840 |
| 2840 if (source_buffer != 0) { | 2841 if (source_buffer != 0) { |
| 2841 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, source_buffer); | 2842 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, source_buffer); |
| 2842 src_pixels = static_cast<uint8*>(gl_->MapBufferCHROMIUM( | 2843 src_pixels = static_cast<uint8*>(gl_->MapBufferCHROMIUM( |
| 2843 GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, GL_READ_ONLY)); | 2844 GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, GL_READ_ONLY)); |
| 2844 | 2845 |
| 2845 if (src_pixels) { | 2846 if (src_pixels) { |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3544 texture_id = pending_overlay_resources_.back()->texture_id(); | 3545 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3545 } | 3546 } |
| 3546 | 3547 |
| 3547 context_support_->ScheduleOverlayPlane( | 3548 context_support_->ScheduleOverlayPlane( |
| 3548 overlay.plane_z_order, overlay.transform, texture_id, | 3549 overlay.plane_z_order, overlay.transform, texture_id, |
| 3549 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3550 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3550 } | 3551 } |
| 3551 } | 3552 } |
| 3552 | 3553 |
| 3553 } // namespace cc | 3554 } // namespace cc |
| OLD | NEW |