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 "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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 526 |
527 gfx::Transform contentsDeviceTransformInverse = MathUtil::inverse(contentsDe
viceTransform); | 527 gfx::Transform contentsDeviceTransformInverse = MathUtil::inverse(contentsDe
viceTransform); |
528 scoped_ptr<ScopedResource> backgroundTexture = drawBackgroundFilters( | 528 scoped_ptr<ScopedResource> backgroundTexture = drawBackgroundFilters( |
529 frame, quad, renderPass->background_filters, | 529 frame, quad, renderPass->background_filters, |
530 contentsDeviceTransform, contentsDeviceTransformInverse); | 530 contentsDeviceTransform, contentsDeviceTransformInverse); |
531 | 531 |
532 // FIXME: Cache this value so that we don't have to do it for both the surfa
ce and its replica. | 532 // FIXME: Cache this value so that we don't have to do it for both the surfa
ce and its replica. |
533 // Apply filters to the contents texture. | 533 // Apply filters to the contents texture. |
534 SkBitmap filterBitmap; | 534 SkBitmap filterBitmap; |
535 if (renderPass->filter) { | 535 if (renderPass->filter) { |
536 filterBitmap = applyImageFilter(this, renderPass->filter, contentsTextur
e, m_client->hasImplThread()); | 536 filterBitmap = applyImageFilter(this, renderPass->filter.get(), contents
Texture, m_client->hasImplThread()); |
537 } else { | 537 } else { |
538 filterBitmap = applyFilters(this, renderPass->filters, contentsTexture,
m_client->hasImplThread()); | 538 filterBitmap = applyFilters(this, renderPass->filters, contentsTexture,
m_client->hasImplThread()); |
539 } | 539 } |
540 scoped_ptr<ResourceProvider::ScopedReadLockGL> contentsResourceLock; | 540 scoped_ptr<ResourceProvider::ScopedReadLockGL> contentsResourceLock; |
541 unsigned contentsTextureId = 0; | 541 unsigned contentsTextureId = 0; |
542 if (filterBitmap.getTexture()) { | 542 if (filterBitmap.getTexture()) { |
543 GrTexture* texture = reinterpret_cast<GrTexture*>(filterBitmap.getTextur
e()); | 543 GrTexture* texture = reinterpret_cast<GrTexture*>(filterBitmap.getTextur
e()); |
544 contentsTextureId = texture->getTextureHandle(); | 544 contentsTextureId = texture->getTextureHandle(); |
545 } else { | 545 } else { |
546 contentsResourceLock = make_scoped_ptr(new ResourceProvider::ScopedReadL
ockGL(m_resourceProvider, contentsTexture->id())); | 546 contentsResourceLock = make_scoped_ptr(new ResourceProvider::ScopedReadL
ockGL(m_resourceProvider, contentsTexture->id())); |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 | 1625 |
1626 releaseRenderPassTextures(); | 1626 releaseRenderPassTextures(); |
1627 } | 1627 } |
1628 | 1628 |
1629 bool GLRenderer::isContextLost() | 1629 bool GLRenderer::isContextLost() |
1630 { | 1630 { |
1631 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1631 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
1632 } | 1632 } |
1633 | 1633 |
1634 } // namespace cc | 1634 } // namespace cc |
OLD | NEW |