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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 1739743003: Blink Compositor Animation: Erase old animation system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude histograms.xml Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
11 #include "base/callback_helpers.h" 11 #include "base/callback_helpers.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/stringprintf.h" 18 #include "base/strings/stringprintf.h"
19 #include "base/strings/utf_offset_string_conversions.h" 19 #include "base/strings/utf_offset_string_conversions.h"
20 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
21 #include "base/thread_task_runner_handle.h" 21 #include "base/thread_task_runner_handle.h"
22 #include "base/time/time.h" 22 #include "base/time/time.h"
23 #include "base/trace_event/trace_event.h" 23 #include "base/trace_event/trace_event.h"
24 #include "build/build_config.h" 24 #include "build/build_config.h"
25 #include "cc/blink/web_layer_impl.h" 25 #include "cc/blink/web_layer_impl.h"
26 #include "cc/layers/layer_settings.h"
26 #include "cc/layers/texture_layer.h" 27 #include "cc/layers/texture_layer.h"
27 #include "content/common/content_constants_internal.h" 28 #include "content/common/content_constants_internal.h"
28 #include "content/common/frame_messages.h" 29 #include "content/common/frame_messages.h"
29 #include "content/public/common/content_constants.h" 30 #include "content/public/common/content_constants.h"
30 #include "content/public/renderer/content_renderer_client.h" 31 #include "content/public/renderer/content_renderer_client.h"
31 #include "content/renderer/pepper/content_decryptor_delegate.h" 32 #include "content/renderer/pepper/content_decryptor_delegate.h"
32 #include "content/renderer/pepper/event_conversion.h" 33 #include "content/renderer/pepper/event_conversion.h"
33 #include "content/renderer/pepper/fullscreen_container.h" 34 #include "content/renderer/pepper/fullscreen_container.h"
34 #include "content/renderer/pepper/gfx_conversion.h" 35 #include "content/renderer/pepper/gfx_conversion.h"
35 #include "content/renderer/pepper/host_dispatcher_wrapper.h" 36 #include "content/renderer/pepper/host_dispatcher_wrapper.h"
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 texture_layer_ = NULL; 2033 texture_layer_ = NULL;
2033 } 2034 }
2034 compositor_layer_ = NULL; 2035 compositor_layer_ = NULL;
2035 } 2036 }
2036 2037
2037 if (want_texture_layer) { 2038 if (want_texture_layer) {
2038 bool opaque = false; 2039 bool opaque = false;
2039 if (want_3d_layer) { 2040 if (want_3d_layer) {
2040 DCHECK(bound_graphics_3d_.get()); 2041 DCHECK(bound_graphics_3d_.get());
2041 texture_layer_ = cc::TextureLayer::CreateForMailbox( 2042 texture_layer_ = cc::TextureLayer::CreateForMailbox(
2042 cc_blink::WebLayerImpl::LayerSettings(), NULL); 2043 cc::LayerSettings(), NULL);
2043 opaque = bound_graphics_3d_->IsOpaque(); 2044 opaque = bound_graphics_3d_->IsOpaque();
2044 texture_layer_->SetTextureMailboxWithoutReleaseCallback( 2045 texture_layer_->SetTextureMailboxWithoutReleaseCallback(
2045 cc::TextureMailbox(mailbox, sync_token, GL_TEXTURE_2D)); 2046 cc::TextureMailbox(mailbox, sync_token, GL_TEXTURE_2D));
2046 } else { 2047 } else {
2047 DCHECK(bound_graphics_2d_platform_); 2048 DCHECK(bound_graphics_2d_platform_);
2048 texture_layer_ = cc::TextureLayer::CreateForMailbox( 2049 texture_layer_ = cc::TextureLayer::CreateForMailbox(
2049 cc_blink::WebLayerImpl::LayerSettings(), this); 2050 cc::LayerSettings(), this);
2050 bound_graphics_2d_platform_->AttachedToNewLayer(); 2051 bound_graphics_2d_platform_->AttachedToNewLayer();
2051 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); 2052 opaque = bound_graphics_2d_platform_->IsAlwaysOpaque();
2052 texture_layer_->SetFlipped(false); 2053 texture_layer_->SetFlipped(false);
2053 } 2054 }
2054 2055
2055 // Ignore transparency in fullscreen, since that's what Flash always 2056 // Ignore transparency in fullscreen, since that's what Flash always
2056 // wants to do, and that lets it not recreate a context if 2057 // wants to do, and that lets it not recreate a context if
2057 // wmode=transparent was specified. 2058 // wmode=transparent was specified.
2058 opaque = opaque || fullscreen_container_; 2059 opaque = opaque || fullscreen_container_;
2059 texture_layer_->SetContentsOpaque(opaque); 2060 texture_layer_->SetContentsOpaque(opaque);
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 } 3322 }
3322 3323
3323 void PepperPluginInstanceImpl::ConvertDIPToViewport(gfx::Rect* rect) const { 3324 void PepperPluginInstanceImpl::ConvertDIPToViewport(gfx::Rect* rect) const {
3324 rect->set_x(rect->x() / viewport_to_dip_scale_); 3325 rect->set_x(rect->x() / viewport_to_dip_scale_);
3325 rect->set_y(rect->y() / viewport_to_dip_scale_); 3326 rect->set_y(rect->y() / viewport_to_dip_scale_);
3326 rect->set_width(rect->width() / viewport_to_dip_scale_); 3327 rect->set_width(rect->width() / viewport_to_dip_scale_);
3327 rect->set_height(rect->height() / viewport_to_dip_scale_); 3328 rect->set_height(rect->height() / viewport_to_dip_scale_);
3328 } 3329 }
3329 3330
3330 } // namespace content 3331 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_compositor_host.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698