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

Side by Side Diff: cc/gl_renderer.cc

Issue 11606012: cc: Unify context losing machinery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
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/gl_renderer.h" 5 #include "cc/gl_renderer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 1503
1504 bool GLRenderer::bindFramebufferToTexture(DrawingFrame& frame, const ScopedResou rce* texture, const gfx::Rect& framebufferRect) 1504 bool GLRenderer::bindFramebufferToTexture(DrawingFrame& frame, const ScopedResou rce* texture, const gfx::Rect& framebufferRect)
1505 { 1505 {
1506 DCHECK(texture->id()); 1506 DCHECK(texture->id());
1507 1507
1508 GLC(m_context, m_context->bindFramebuffer(GL_FRAMEBUFFER, m_offscreenFramebu fferId)); 1508 GLC(m_context, m_context->bindFramebuffer(GL_FRAMEBUFFER, m_offscreenFramebu fferId));
1509 m_currentFramebufferLock = make_scoped_ptr(new ResourceProvider::ScopedWrite LockGL(m_resourceProvider, texture->id())); 1509 m_currentFramebufferLock = make_scoped_ptr(new ResourceProvider::ScopedWrite LockGL(m_resourceProvider, texture->id()));
1510 unsigned textureId = m_currentFramebufferLock->textureId(); 1510 unsigned textureId = m_currentFramebufferLock->textureId();
1511 GLC(m_context, m_context->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTA CHMENT0, GL_TEXTURE_2D, textureId, 0)); 1511 GLC(m_context, m_context->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTA CHMENT0, GL_TEXTURE_2D, textureId, 0));
1512 1512
1513 DCHECK(m_context->checkFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_C OMPLETE); 1513 if (m_context->checkFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMP LETE)
jamesr 2012/12/18 05:40:11 this is a sync call and pretty expensive in some d
danakj 2012/12/18 06:06:57 Then we should probably just remove this line. The
danakj 2012/12/18 21:26:59 Done.
1514 return false;
1514 1515
1515 initializeMatrices(frame, framebufferRect, false); 1516 initializeMatrices(frame, framebufferRect, false);
1516 setDrawViewportSize(framebufferRect.size()); 1517 setDrawViewportSize(framebufferRect.size());
1517 1518
1518 return true; 1519 return true;
1519 } 1520 }
1520 1521
1521 void GLRenderer::setScissorTestRect(const gfx::Rect& scissorRect) 1522 void GLRenderer::setScissorTestRect(const gfx::Rect& scissorRect)
1522 { 1523 {
1523 ensureScissorTestEnabled(); 1524 ensureScissorTestEnabled();
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 1797
1797 releaseRenderPassTextures(); 1798 releaseRenderPassTextures();
1798 } 1799 }
1799 1800
1800 bool GLRenderer::isContextLost() 1801 bool GLRenderer::isContextLost()
1801 { 1802 {
1802 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); 1803 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR);
1803 } 1804 }
1804 1805
1805 } // namespace cc 1806 } // namespace cc
OLDNEW
« no previous file with comments | « cc/DEPS ('k') | cc/layer_tree_host_impl.cc » ('j') | cc/test/fake_web_graphics_context_3d.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698