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/gl_renderer.h" | 5 #include "cc/gl_renderer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 ResourceProvider::ScopedWriteLockGL lock(renderer->resourceProvider(), sourc
eTextureResource->id()); | 389 ResourceProvider::ScopedWriteLockGL lock(renderer->resourceProvider(), sourc
eTextureResource->id()); |
390 | 390 |
391 // Flush the compositor context to ensure that textures there are available | 391 // Flush the compositor context to ensure that textures there are available |
392 // in the shared context. Do this after locking/creating the compositor | 392 // in the shared context. Do this after locking/creating the compositor |
393 // texture. | 393 // texture. |
394 renderer->resourceProvider()->Flush(); | 394 renderer->resourceProvider()->Flush(); |
395 | 395 |
396 // Make sure skia uses the correct GL context. | 396 // Make sure skia uses the correct GL context. |
397 offscreenContexts->Context3d()->makeContextCurrent(); | 397 offscreenContexts->Context3d()->makeContextCurrent(); |
398 | 398 |
399 SkBitmap source = RenderSurfaceFilters::apply(filters, lock.texture_id(), so
urceTextureResource->size(), offscreenContexts->GrContext()); | 399 SkBitmap source = RenderSurfaceFilters::Apply(filters, lock.texture_id(), so
urceTextureResource->size(), offscreenContexts->GrContext()); |
400 | 400 |
401 // Flush skia context so that all the rendered stuff appears on the | 401 // Flush skia context so that all the rendered stuff appears on the |
402 // texture. | 402 // texture. |
403 offscreenContexts->GrContext()->flush(); | 403 offscreenContexts->GrContext()->flush(); |
404 | 404 |
405 // Flush the GL context so rendering results from this context are | 405 // Flush the GL context so rendering results from this context are |
406 // visible in the compositor's context. | 406 // visible in the compositor's context. |
407 offscreenContexts->Context3d()->flush(); | 407 offscreenContexts->Context3d()->flush(); |
408 | 408 |
409 // Use the compositor's GL context again. | 409 // Use the compositor's GL context again. |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 | 1862 |
1863 releaseRenderPassTextures(); | 1863 releaseRenderPassTextures(); |
1864 } | 1864 } |
1865 | 1865 |
1866 bool GLRenderer::isContextLost() | 1866 bool GLRenderer::isContextLost() |
1867 { | 1867 { |
1868 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1868 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
1869 } | 1869 } |
1870 | 1870 |
1871 } // namespace cc | 1871 } // namespace cc |
OLD | NEW |