| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/io_surface_layer_impl.h" | 7 #include "cc/io_surface_layer_impl.h" |
| 8 | 8 |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "cc/gl_renderer.h" // For the GLC() macro. | 10 #include "cc/gl_renderer.h" // For the GLC() macro. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // allocated. | 72 // allocated. |
| 73 m_ioSurfaceChanged = false; | 73 m_ioSurfaceChanged = false; |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 void IOSurfaceLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
QuadsData) | 77 void IOSurfaceLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
QuadsData) |
| 78 { | 78 { |
| 79 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 79 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
| 80 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); | 80 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); |
| 81 | 81 |
| 82 IntRect quadRect(IntPoint(), contentBounds()); | 82 gfx::Rect quadRect(gfx::Point(), contentBounds()); |
| 83 quadSink.append(IOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_ioSur
faceSize, m_ioSurfaceTextureId, IOSurfaceDrawQuad::Flipped).PassAs<DrawQuad>(),
appendQuadsData); | 83 quadSink.append(IOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_ioSur
faceSize, m_ioSurfaceTextureId, IOSurfaceDrawQuad::Flipped).PassAs<DrawQuad>(),
appendQuadsData); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void IOSurfaceLayerImpl::dumpLayerProperties(std::string* str, int indent) const | 86 void IOSurfaceLayerImpl::dumpLayerProperties(std::string* str, int indent) const |
| 87 { | 87 { |
| 88 str->append(indentString(indent)); | 88 str->append(indentString(indent)); |
| 89 base::StringAppendF(str, "iosurface id: %u texture id: %u\n", m_ioSurfaceId,
m_ioSurfaceTextureId); | 89 base::StringAppendF(str, "iosurface id: %u texture id: %u\n", m_ioSurfaceId,
m_ioSurfaceTextureId); |
| 90 LayerImpl::dumpLayerProperties(str, indent); | 90 LayerImpl::dumpLayerProperties(str, indent); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void IOSurfaceLayerImpl::didLoseContext() | 93 void IOSurfaceLayerImpl::didLoseContext() |
| 94 { | 94 { |
| 95 // We don't have a valid texture ID in the new context; however, | 95 // We don't have a valid texture ID in the new context; however, |
| 96 // the IOSurface is still valid. | 96 // the IOSurface is still valid. |
| 97 m_ioSurfaceTextureId = 0; | 97 m_ioSurfaceTextureId = 0; |
| 98 m_ioSurfaceChanged = true; | 98 m_ioSurfaceChanged = true; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void IOSurfaceLayerImpl::setIOSurfaceProperties(unsigned ioSurfaceId, const IntS
ize& size) | 101 void IOSurfaceLayerImpl::setIOSurfaceProperties(unsigned ioSurfaceId, const gfx:
:Size& size) |
| 102 { | 102 { |
| 103 if (m_ioSurfaceId != ioSurfaceId) | 103 if (m_ioSurfaceId != ioSurfaceId) |
| 104 m_ioSurfaceChanged = true; | 104 m_ioSurfaceChanged = true; |
| 105 | 105 |
| 106 m_ioSurfaceId = ioSurfaceId; | 106 m_ioSurfaceId = ioSurfaceId; |
| 107 m_ioSurfaceSize = size; | 107 m_ioSurfaceSize = size; |
| 108 } | 108 } |
| 109 | 109 |
| 110 const char* IOSurfaceLayerImpl::layerTypeAsString() const | 110 const char* IOSurfaceLayerImpl::layerTypeAsString() const |
| 111 { | 111 { |
| 112 return "IOSurfaceLayer"; | 112 return "IOSurfaceLayer"; |
| 113 } | 113 } |
| 114 | 114 |
| 115 } | 115 } |
| OLD | NEW |