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

Side by Side Diff: cc/layers/texture_layer.cc

Issue 17859002: Allow WebExternalTextureLayers to receive a bitmap along with a mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use ShareMemory path Created 7 years, 5 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 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 "cc/layers/texture_layer.h" 5 #include "cc/layers/texture_layer.h"
6 6
7 #include "cc/base/thread.h" 7 #include "cc/base/thread.h"
8 #include "cc/layers/texture_layer_client.h" 8 #include "cc/layers/texture_layer_client.h"
9 #include "cc/layers/texture_layer_impl.h" 9 #include "cc/layers/texture_layer_impl.h"
10 #include "cc/trees/layer_tree_host.h" 10 #include "cc/trees/layer_tree_host.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 SetNeedsCommit(); 152 SetNeedsCommit();
153 } 153 }
154 154
155 void TextureLayer::WillModifyTexture() { 155 void TextureLayer::WillModifyTexture() {
156 if (layer_tree_host() && (DrawsContent() || content_committed_)) { 156 if (layer_tree_host() && (DrawsContent() || content_committed_)) {
157 layer_tree_host()->AcquireLayerTextures(); 157 layer_tree_host()->AcquireLayerTextures();
158 content_committed_ = false; 158 content_committed_ = false;
159 } 159 }
160 } 160 }
161 161
162 bool TextureLayer::MustUseSharedMemory() {
163 return !layer_tree_host()->UsingGLRenderer();
piman 2013/07/01 22:45:01 note: layer_tree_host() is NULL when the layer is
jbauman 2013/07/02 00:00:40 Ok, modified PrepareTextureMailbox to do this inst
164 }
165
162 void TextureLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) { 166 void TextureLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
163 Layer::SetNeedsDisplayRect(dirty_rect); 167 Layer::SetNeedsDisplayRect(dirty_rect);
164 168
165 if (rate_limit_context_ && client_ && layer_tree_host() && DrawsContent()) 169 if (rate_limit_context_ && client_ && layer_tree_host() && DrawsContent())
166 layer_tree_host()->StartRateLimiter(client_->Context3d()); 170 layer_tree_host()->StartRateLimiter(client_->Context3d());
167 } 171 }
168 172
169 void TextureLayer::SetLayerTreeHost(LayerTreeHost* host) { 173 void TextureLayer::SetLayerTreeHost(LayerTreeHost* host) {
170 if (texture_id_ && layer_tree_host() && host != layer_tree_host()) 174 if (texture_id_ && layer_tree_host() && host != layer_tree_host())
171 layer_tree_host()->AcquireLayerTextures(); 175 layer_tree_host()->AcquireLayerTextures();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 TextureLayer::MailboxHolder::~MailboxHolder() { 255 TextureLayer::MailboxHolder::~MailboxHolder() {
252 mailbox_.RunReleaseCallback(sync_point_, is_lost_); 256 mailbox_.RunReleaseCallback(sync_point_, is_lost_);
253 } 257 }
254 258
255 void TextureLayer::MailboxHolder::Return(unsigned sync_point, bool is_lost) { 259 void TextureLayer::MailboxHolder::Return(unsigned sync_point, bool is_lost) {
256 sync_point_ = sync_point; 260 sync_point_ = sync_point;
257 is_lost_ = is_lost; 261 is_lost_ = is_lost;
258 } 262 }
259 263
260 } // namespace cc 264 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698