| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/io_surface_layer_impl.h" | 5 #include "cc/io_surface_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "cc/gl_renderer.h" // For the GLC() macro. | 8 #include "cc/gl_renderer.h" // For the GLC() macro. |
| 9 #include "cc/graphics_context.h" | 9 #include "cc/graphics_context.h" |
| 10 #include "cc/io_surface_draw_quad.h" | 10 #include "cc/io_surface_draw_quad.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 m_ioSurfaceChanged = false; | 71 m_ioSurfaceChanged = false; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 void IOSurfaceLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
QuadsData) | 75 void IOSurfaceLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
QuadsData) |
| 76 { | 76 { |
| 77 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 77 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
| 78 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); | 78 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); |
| 79 | 79 |
| 80 gfx::Rect quadRect(gfx::Point(), contentBounds()); | 80 gfx::Rect quadRect(gfx::Point(), contentBounds()); |
| 81 quadSink.append(IOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_ioSur
faceSize, m_ioSurfaceTextureId, IOSurfaceDrawQuad::Flipped).PassAs<DrawQuad>(),
appendQuadsData); | 81 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); |
| 82 quadSink.append(IOSurfaceDrawQuad::create(sharedQuadState, quadRect, opaqueR
ect, m_ioSurfaceSize, m_ioSurfaceTextureId, IOSurfaceDrawQuad::Flipped).PassAs<D
rawQuad>(), appendQuadsData); |
| 82 } | 83 } |
| 83 | 84 |
| 84 void IOSurfaceLayerImpl::dumpLayerProperties(std::string* str, int indent) const | 85 void IOSurfaceLayerImpl::dumpLayerProperties(std::string* str, int indent) const |
| 85 { | 86 { |
| 86 str->append(indentString(indent)); | 87 str->append(indentString(indent)); |
| 87 base::StringAppendF(str, "iosurface id: %u texture id: %u\n", m_ioSurfaceId,
m_ioSurfaceTextureId); | 88 base::StringAppendF(str, "iosurface id: %u texture id: %u\n", m_ioSurfaceId,
m_ioSurfaceTextureId); |
| 88 LayerImpl::dumpLayerProperties(str, indent); | 89 LayerImpl::dumpLayerProperties(str, indent); |
| 89 } | 90 } |
| 90 | 91 |
| 91 void IOSurfaceLayerImpl::didLoseContext() | 92 void IOSurfaceLayerImpl::didLoseContext() |
| (...skipping 12 matching lines...) Expand all Loading... |
| 104 m_ioSurfaceId = ioSurfaceId; | 105 m_ioSurfaceId = ioSurfaceId; |
| 105 m_ioSurfaceSize = size; | 106 m_ioSurfaceSize = size; |
| 106 } | 107 } |
| 107 | 108 |
| 108 const char* IOSurfaceLayerImpl::layerTypeAsString() const | 109 const char* IOSurfaceLayerImpl::layerTypeAsString() const |
| 109 { | 110 { |
| 110 return "IOSurfaceLayer"; | 111 return "IOSurfaceLayer"; |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace cc | 114 } // namespace cc |
| OLD | NEW |