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" |
11 #include "cc/layers/texture_layer.h" | 11 #include "cc/layers/texture_layer.h" |
12 #include "cc/resources/texture_mailbox.h" | 12 #include "cc/resources/texture_mailbox.h" |
| 13 #include "cc/trees/layer_tree_host.h" |
13 #include "content/public/renderer/renderer_ppapi_host.h" | 14 #include "content/public/renderer/renderer_ppapi_host.h" |
14 #include "content/renderer/pepper/gfx_conversion.h" | 15 #include "content/renderer/pepper/gfx_conversion.h" |
15 #include "content/renderer/pepper/host_globals.h" | 16 #include "content/renderer/pepper/host_globals.h" |
16 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 17 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
17 #include "content/renderer/pepper/ppb_image_data_impl.h" | 18 #include "content/renderer/pepper/ppb_image_data_impl.h" |
18 #include "ppapi/c/pp_errors.h" | 19 #include "ppapi/c/pp_errors.h" |
19 #include "ppapi/host/dispatch_host_message.h" | 20 #include "ppapi/host/dispatch_host_message.h" |
20 #include "ppapi/host/ppapi_host.h" | 21 #include "ppapi/host/ppapi_host.h" |
21 #include "ppapi/proxy/ppapi_messages.h" | 22 #include "ppapi/proxy/ppapi_messages.h" |
22 #include "ppapi/thunk/enter.h" | 23 #include "ppapi/thunk/enter.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 } | 360 } |
360 | 361 |
361 UpdateLayer(cc_layer, old_layer, pp_layer, image_shms[i].Pass()); | 362 UpdateLayer(cc_layer, old_layer, pp_layer, image_shms[i].Pass()); |
362 | 363 |
363 if (old_layer) | 364 if (old_layer) |
364 *old_layer = *pp_layer; | 365 *old_layer = *pp_layer; |
365 else | 366 else |
366 layers_.push_back(LayerData(cc_layer, *pp_layer)); | 367 layers_.push_back(LayerData(cc_layer, *pp_layer)); |
367 } | 368 } |
368 | 369 |
| 370 // We need to force a commit for each CommitLayers() call, even if no layers |
| 371 // changed since the last call to CommitLayers(). This is so |
| 372 // WiewInitiatedPaint() will always be called. |
| 373 if (layer_->layer_tree_host()) |
| 374 layer_->layer_tree_host()->SetNeedsCommit(); |
| 375 |
369 return PP_OK_COMPLETIONPENDING; | 376 return PP_OK_COMPLETIONPENDING; |
370 } | 377 } |
371 | 378 |
372 } // namespace content | 379 } // namespace content |
OLD | NEW |