| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/gl_renderer.h" | 7 #include "cc/gl_renderer.h" |
| 8 | 8 |
| 9 #include "FloatRect.h" | |
| 10 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 11 #include "base/logging.h" | 10 #include "base/logging.h" |
| 12 #include "base/string_split.h" | 11 #include "base/string_split.h" |
| 13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 14 #include "cc/damage_tracker.h" | 13 #include "cc/damage_tracker.h" |
| 15 #include "cc/geometry_binding.h" | 14 #include "cc/geometry_binding.h" |
| 16 #include "cc/layer_quad.h" | 15 #include "cc/layer_quad.h" |
| 17 #include "cc/math_util.h" | 16 #include "cc/math_util.h" |
| 18 #include "cc/platform_color.h" | 17 #include "cc/platform_color.h" |
| 19 #include "cc/priority_calculator.h" | 18 #include "cc/priority_calculator.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 copyTextureToFramebuffer(frame, lock.textureId(), quad->quadRect(), quad
->quadTransform()); | 544 copyTextureToFramebuffer(frame, lock.textureId(), quad->quadRect(), quad
->quadTransform()); |
| 546 } | 545 } |
| 547 | 546 |
| 548 bool clipped = false; | 547 bool clipped = false; |
| 549 gfx::QuadF deviceQuad = MathUtil::mapQuad(contentsDeviceTransform, sharedGeo
metryQuad(), clipped); | 548 gfx::QuadF deviceQuad = MathUtil::mapQuad(contentsDeviceTransform, sharedGeo
metryQuad(), clipped); |
| 550 DCHECK(!clipped); | 549 DCHECK(!clipped); |
| 551 LayerQuad deviceLayerBounds = LayerQuad(gfx::QuadF(deviceQuad.BoundingBox())
); | 550 LayerQuad deviceLayerBounds = LayerQuad(gfx::QuadF(deviceQuad.BoundingBox())
); |
| 552 LayerQuad deviceLayerEdges = LayerQuad(deviceQuad); | 551 LayerQuad deviceLayerEdges = LayerQuad(deviceQuad); |
| 553 | 552 |
| 554 // Use anti-aliasing programs only when necessary. | 553 // Use anti-aliasing programs only when necessary. |
| 555 bool useAA = (!deviceQuad.IsRectilinear() || !cc::FloatRect(deviceQuad.Bound
ingBox()).isExpressibleAsIntRect()); | 554 bool useAA = (!deviceQuad.IsRectilinear() || !deviceQuad.BoundingBox().IsExp
ressibleAsRect()); |
| 556 if (useAA) { | 555 if (useAA) { |
| 557 deviceLayerBounds.inflateAntiAliasingDistance(); | 556 deviceLayerBounds.inflateAntiAliasingDistance(); |
| 558 deviceLayerEdges.inflateAntiAliasingDistance(); | 557 deviceLayerEdges.inflateAntiAliasingDistance(); |
| 559 } | 558 } |
| 560 | 559 |
| 561 scoped_ptr<ResourceProvider::ScopedReadLockGL> maskResourceLock; | 560 scoped_ptr<ResourceProvider::ScopedReadLockGL> maskResourceLock; |
| 562 unsigned maskTextureId = 0; | 561 unsigned maskTextureId = 0; |
| 563 if (quad->maskResourceId()) { | 562 if (quad->maskResourceId()) { |
| 564 maskResourceLock.reset(new ResourceProvider::ScopedReadLockGL(m_resource
Provider, quad->maskResourceId())); | 563 maskResourceLock.reset(new ResourceProvider::ScopedReadLockGL(m_resource
Provider, quad->maskResourceId())); |
| 565 maskTextureId = maskResourceLock->textureId(); | 564 maskTextureId = maskResourceLock->textureId(); |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1626 | 1625 |
| 1627 releaseRenderPassTextures(); | 1626 releaseRenderPassTextures(); |
| 1628 } | 1627 } |
| 1629 | 1628 |
| 1630 bool GLRenderer::isContextLost() | 1629 bool GLRenderer::isContextLost() |
| 1631 { | 1630 { |
| 1632 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1631 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 1633 } | 1632 } |
| 1634 | 1633 |
| 1635 } // namespace cc | 1634 } // namespace cc |
| OLD | NEW |