| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/texture_layer_impl.h" | 7 #include "cc/texture_layer_impl.h" |
| 8 | 8 |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "cc/quad_sink.h" | 10 #include "cc/quad_sink.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 void TextureLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQu
adsData) | 38 void TextureLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQu
adsData) |
| 39 { | 39 { |
| 40 if (!m_externalTextureResource) | 40 if (!m_externalTextureResource) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 43 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
| 44 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); | 44 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); |
| 45 | 45 |
| 46 IntRect quadRect(IntPoint(), contentBounds()); | 46 gfx::Rect quadRect(gfx::Point(), contentBounds()); |
| 47 quadSink.append(TextureDrawQuad::create(sharedQuadState, quadRect, m_externa
lTextureResource, m_premultipliedAlpha, m_uvRect, m_flipped).PassAs<DrawQuad>(),
appendQuadsData); | 47 quadSink.append(TextureDrawQuad::create(sharedQuadState, quadRect, m_externa
lTextureResource, m_premultipliedAlpha, m_uvRect, m_flipped).PassAs<DrawQuad>(),
appendQuadsData); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void TextureLayerImpl::didDraw(ResourceProvider* resourceProvider) | 50 void TextureLayerImpl::didDraw(ResourceProvider* resourceProvider) |
| 51 { | 51 { |
| 52 if (!m_externalTextureResource) | 52 if (!m_externalTextureResource) |
| 53 return; | 53 return; |
| 54 // FIXME: the following assert will not be true when sending resources to a | 54 // FIXME: the following assert will not be true when sending resources to a |
| 55 // parent compositor. A synchronization scheme (double-buffering or | 55 // parent compositor. A synchronization scheme (double-buffering or |
| 56 // pipelining of updates) for the client will need to exist to solve this. | 56 // pipelining of updates) for the client will need to exist to solve this. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 71 m_textureId = 0; | 71 m_textureId = 0; |
| 72 m_externalTextureResource = 0; | 72 m_externalTextureResource = 0; |
| 73 } | 73 } |
| 74 | 74 |
| 75 const char* TextureLayerImpl::layerTypeAsString() const | 75 const char* TextureLayerImpl::layerTypeAsString() const |
| 76 { | 76 { |
| 77 return "TextureLayer"; | 77 return "TextureLayer"; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } | 80 } |
| OLD | NEW |