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

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

Issue 899183003: Fix double lock of texture resource in software renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add tests and comments Created 5 years, 10 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/output/software_renderer.cc » ('j') | cc/output/software_renderer_unittest.cc » ('J')
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 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 } else { 2705 } else {
2706 SetStencilEnabled(false); 2706 SetStencilEnabled(false);
2707 } 2707 }
2708 } 2708 }
2709 2709
2710 bool GLRenderer::BindFramebufferToTexture(DrawingFrame* frame, 2710 bool GLRenderer::BindFramebufferToTexture(DrawingFrame* frame,
2711 const ScopedResource* texture, 2711 const ScopedResource* texture,
2712 const gfx::Rect& target_rect) { 2712 const gfx::Rect& target_rect) {
2713 DCHECK(texture->id()); 2713 DCHECK(texture->id());
2714 2714
2715 // Explicitly release lock, otherwise we can crash when try to lock
2716 // same texture again.
2715 current_framebuffer_lock_ = nullptr; 2717 current_framebuffer_lock_ = nullptr;
2716 2718
2717 SetStencilEnabled(false); 2719 SetStencilEnabled(false);
2718 GLC(gl_, gl_->BindFramebuffer(GL_FRAMEBUFFER, offscreen_framebuffer_id_)); 2720 GLC(gl_, gl_->BindFramebuffer(GL_FRAMEBUFFER, offscreen_framebuffer_id_));
2719 current_framebuffer_lock_ = 2721 current_framebuffer_lock_ =
2720 make_scoped_ptr(new ResourceProvider::ScopedWriteLockGL( 2722 make_scoped_ptr(new ResourceProvider::ScopedWriteLockGL(
2721 resource_provider_, texture->id())); 2723 resource_provider_, texture->id()));
2722 unsigned texture_id = current_framebuffer_lock_->texture_id(); 2724 unsigned texture_id = current_framebuffer_lock_->texture_id();
2723 GLC(gl_, 2725 GLC(gl_,
2724 gl_->FramebufferTexture2D( 2726 gl_->FramebufferTexture2D(
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
3306 context_support_->ScheduleOverlayPlane( 3308 context_support_->ScheduleOverlayPlane(
3307 overlay.plane_z_order, 3309 overlay.plane_z_order,
3308 overlay.transform, 3310 overlay.transform,
3309 pending_overlay_resources_.back()->texture_id(), 3311 pending_overlay_resources_.back()->texture_id(),
3310 overlay.display_rect, 3312 overlay.display_rect,
3311 overlay.uv_rect); 3313 overlay.uv_rect);
3312 } 3314 }
3313 } 3315 }
3314 3316
3315 } // namespace cc 3317 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/software_renderer.cc » ('j') | cc/output/software_renderer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698