OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/pepper/pepper_compositor_host.h" | 5 #include "content/renderer/pepper/pepper_compositor_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 new_layer->color->blue * 255)); | 245 new_layer->color->blue * 255)); |
246 return; | 246 return; |
247 } | 247 } |
248 | 248 |
249 if (new_layer->texture) { | 249 if (new_layer->texture) { |
250 scoped_refptr<cc::TextureLayer> texture_layer( | 250 scoped_refptr<cc::TextureLayer> texture_layer( |
251 static_cast<cc::TextureLayer*>(layer.get())); | 251 static_cast<cc::TextureLayer*>(layer.get())); |
252 if (!old_layer || | 252 if (!old_layer || |
253 new_layer->common.resource_id != old_layer->common.resource_id) { | 253 new_layer->common.resource_id != old_layer->common.resource_id) { |
254 cc::TextureMailbox mailbox(new_layer->texture->mailbox, | 254 cc::TextureMailbox mailbox(new_layer->texture->mailbox, |
255 GL_TEXTURE_2D, | 255 new_layer->texture->target, |
256 new_layer->texture->sync_point); | 256 new_layer->texture->sync_point); |
257 texture_layer->SetTextureMailbox(mailbox, | 257 texture_layer->SetTextureMailbox(mailbox, |
258 cc::SingleReleaseCallback::Create( | 258 cc::SingleReleaseCallback::Create( |
259 base::Bind(&PepperCompositorHost::ResourceReleased, | 259 base::Bind(&PepperCompositorHost::ResourceReleased, |
260 weak_factory_.GetWeakPtr(), | 260 weak_factory_.GetWeakPtr(), |
261 new_layer->common.resource_id)));; | 261 new_layer->common.resource_id)));; |
262 } | 262 } |
263 texture_layer->SetPremultipliedAlpha(new_layer->texture->premult_alpha); | 263 texture_layer->SetPremultipliedAlpha(new_layer->texture->premult_alpha); |
264 gfx::RectF rect = PP_ToGfxRectF(new_layer->texture->source_rect); | 264 gfx::RectF rect = PP_ToGfxRectF(new_layer->texture->source_rect); |
265 texture_layer->SetUV(rect.origin(), rect.bottom_right()); | 265 texture_layer->SetUV(rect.origin(), rect.bottom_right()); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 376 |
377 // If the host is not bound to the instance, return PP_OK immediately. | 377 // If the host is not bound to the instance, return PP_OK immediately. |
378 if (!bound_instance_) | 378 if (!bound_instance_) |
379 return PP_OK; | 379 return PP_OK; |
380 | 380 |
381 commit_layers_reply_context_ = context->MakeReplyMessageContext(); | 381 commit_layers_reply_context_ = context->MakeReplyMessageContext(); |
382 return PP_OK_COMPLETIONPENDING; | 382 return PP_OK_COMPLETIONPENDING; |
383 } | 383 } |
384 | 384 |
385 } // namespace content | 385 } // namespace content |
OLD | NEW |