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

Side by Side Diff: cc/output/gl_renderer.cc

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « cc/output/gl_renderer.h ('k') | cc/output/gl_renderer_unittest.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 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
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 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 // callbacks to this function are in the same order as we post the copy 2827 // callbacks to this function are in the same order as we post the copy
2827 // requests. 2828 // requests.
2828 // Nevertheless, it is very likely that the order is preserved, and thus 2829 // Nevertheless, it is very likely that the order is preserved, and thus
2829 // start searching from back to the front. 2830 // start searching from back to the front.
2830 auto iter = pending_async_read_pixels_.rbegin(); 2831 auto iter = pending_async_read_pixels_.rbegin();
2831 const auto& reverse_end = pending_async_read_pixels_.rend(); 2832 const auto& reverse_end = pending_async_read_pixels_.rend();
2832 while (iter != reverse_end && (*iter)->buffer != source_buffer) 2833 while (iter != reverse_end && (*iter)->buffer != source_buffer)
2833 ++iter; 2834 ++iter;
2834 2835
2835 DCHECK(iter != reverse_end); 2836 DCHECK(iter != reverse_end);
2836 PendingAsyncReadPixels* current_read = *iter; 2837 PendingAsyncReadPixels* current_read = iter->get();
2837 2838
2838 uint8* src_pixels = NULL; 2839 uint8* src_pixels = NULL;
2839 scoped_ptr<SkBitmap> bitmap; 2840 scoped_ptr<SkBitmap> bitmap;
2840 2841
2841 if (source_buffer != 0) { 2842 if (source_buffer != 0) {
2842 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, source_buffer); 2843 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, source_buffer);
2843 src_pixels = static_cast<uint8*>(gl_->MapBufferCHROMIUM( 2844 src_pixels = static_cast<uint8*>(gl_->MapBufferCHROMIUM(
2844 GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, GL_READ_ONLY)); 2845 GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, GL_READ_ONLY));
2845 2846
2846 if (src_pixels) { 2847 if (src_pixels) {
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
3571 texture_id = pending_overlay_resources_.back()->texture_id(); 3572 texture_id = pending_overlay_resources_.back()->texture_id();
3572 } 3573 }
3573 3574
3574 context_support_->ScheduleOverlayPlane( 3575 context_support_->ScheduleOverlayPlane(
3575 overlay.plane_z_order, overlay.transform, texture_id, 3576 overlay.plane_z_order, overlay.transform, texture_id,
3576 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3577 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3577 } 3578 }
3578 } 3579 }
3579 3580
3580 } // namespace cc 3581 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698