Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: cc/texture_layer_impl.cc

Issue 11882037: Activate LayerImpl tree with sync+push instead of pointer swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "cc/texture_layer_impl.h" 5 #include "cc/texture_layer_impl.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "cc/layer_tree_impl.h" 8 #include "cc/layer_tree_impl.h"
9 #include "cc/quad_sink.h" 9 #include "cc/quad_sink.h"
10 #include "cc/renderer.h" 10 #include "cc/renderer.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return; 47 return;
48 // Two commits without a draw, ack the previous mailbox. 48 // Two commits without a draw, ack the previous mailbox.
49 if (m_hasPendingMailbox && !m_pendingMailboxReleaseCallback.is_null()) 49 if (m_hasPendingMailbox && !m_pendingMailboxReleaseCallback.is_null())
50 m_pendingMailboxReleaseCallback.Run(0); 50 m_pendingMailboxReleaseCallback.Run(0);
51 51
52 m_pendingMailboxName = mailboxName; 52 m_pendingMailboxName = mailboxName;
53 m_hasPendingMailbox = true; 53 m_hasPendingMailbox = true;
54 m_pendingMailboxReleaseCallback = releaseCallback; 54 m_pendingMailboxReleaseCallback = releaseCallback;
55 } 55 }
56 56
57 scoped_ptr<LayerImpl> TextureLayerImpl::createLayerImpl(LayerTreeImpl* treeImpl)
58 {
59 return TextureLayerImpl::create(treeImpl, id(), m_usesMailbox).PassAs<LayerI mpl>();
60 }
61
62 void TextureLayerImpl::pushPropertiesTo(LayerImpl* layer)
63 {
64 LayerImpl::pushPropertiesTo(layer);
65
66 TextureLayerImpl* textureLayer = static_cast<TextureLayerImpl*>(layer);
67 textureLayer->setFlipped(m_flipped);
68 textureLayer->setUVRect(m_uvRect);
69 textureLayer->setVertexOpacity(m_vertexOpacity);
70 textureLayer->setPremultipliedAlpha(m_premultipliedAlpha);
71 if (m_usesMailbox) {
72 textureLayer->setTextureMailbox(m_pendingMailboxName, m_pendingMailboxRe leaseCallback);
73 m_pendingMailboxReleaseCallback.Reset();
74 } else {
75 textureLayer->setTextureId(m_textureId);
76 }
77 }
78
79
57 void TextureLayerImpl::willDraw(ResourceProvider* resourceProvider) 80 void TextureLayerImpl::willDraw(ResourceProvider* resourceProvider)
58 { 81 {
59 if (!m_usesMailbox) { 82 if (!m_usesMailbox) {
60 if (!m_textureId) 83 if (!m_textureId)
61 return; 84 return;
62 DCHECK(!m_externalTextureResource); 85 DCHECK(!m_externalTextureResource);
63 m_externalTextureResource = resourceProvider->createResourceFromExternal Texture(m_textureId); 86 m_externalTextureResource = resourceProvider->createResourceFromExternal Texture(m_textureId);
64 return; 87 return;
65 } 88 }
66 89
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 { 157 {
135 return "TextureLayer"; 158 return "TextureLayer";
136 } 159 }
137 160
138 bool TextureLayerImpl::canClipSelf() const 161 bool TextureLayerImpl::canClipSelf() const
139 { 162 {
140 return true; 163 return true;
141 } 164 }
142 165
143 } // namespace cc 166 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698