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

Side by Side Diff: content/renderer/child_frame_compositing_helper.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 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/child_frame_compositing_helper.h" 5 #include "content/renderer/child_frame_compositing_helper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/blink/web_layer_impl.h" 9 #include "cc/blink/web_layer_impl.h"
10 #include "cc/layers/layer_settings.h"
10 #include "cc/layers/solid_color_layer.h" 11 #include "cc/layers/solid_color_layer.h"
11 #include "cc/layers/surface_layer.h" 12 #include "cc/layers/surface_layer.h"
12 #include "cc/output/context_provider.h" 13 #include "cc/output/context_provider.h"
13 #include "cc/output/copy_output_request.h" 14 #include "cc/output/copy_output_request.h"
14 #include "cc/output/copy_output_result.h" 15 #include "cc/output/copy_output_result.h"
15 #include "cc/resources/single_release_callback.h" 16 #include "cc/resources/single_release_callback.h"
16 #include "content/child/thread_safe_sender.h" 17 #include "content/child/thread_safe_sender.h"
17 #include "content/common/browser_plugin/browser_plugin_messages.h" 18 #include "content/common/browser_plugin/browser_plugin_messages.h"
18 #include "content/common/content_switches_internal.h" 19 #include "content/common/content_switches_internal.h"
19 #include "content/common/frame_messages.h" 20 #include "content/common/frame_messages.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 layer->SetBounds(device_scale_adjusted_size); 106 layer->SetBounds(device_scale_adjusted_size);
106 } 107 }
107 } 108 }
108 109
109 void ChildFrameCompositingHelper::OnContainerDestroy() { 110 void ChildFrameCompositingHelper::OnContainerDestroy() {
110 UpdateWebLayer(nullptr); 111 UpdateWebLayer(nullptr);
111 } 112 }
112 113
113 void ChildFrameCompositingHelper::ChildFrameGone() { 114 void ChildFrameCompositingHelper::ChildFrameGone() {
114 scoped_refptr<cc::SolidColorLayer> crashed_layer = 115 scoped_refptr<cc::SolidColorLayer> crashed_layer =
115 cc::SolidColorLayer::Create(cc_blink::WebLayerImpl::LayerSettings()); 116 cc::SolidColorLayer::Create(cc::LayerSettings());
116 crashed_layer->SetMasksToBounds(true); 117 crashed_layer->SetMasksToBounds(true);
117 crashed_layer->SetBackgroundColor(SkColorSetARGBInline(255, 0, 128, 0)); 118 crashed_layer->SetBackgroundColor(SkColorSetARGBInline(255, 0, 128, 0));
118 blink::WebLayer* layer = new cc_blink::WebLayerImpl(crashed_layer); 119 blink::WebLayer* layer = new cc_blink::WebLayerImpl(crashed_layer);
119 UpdateWebLayer(layer); 120 UpdateWebLayer(layer);
120 } 121 }
121 122
122 // static 123 // static
123 void ChildFrameCompositingHelper::SatisfyCallback( 124 void ChildFrameCompositingHelper::SatisfyCallback(
124 scoped_refptr<ThreadSafeSender> sender, 125 scoped_refptr<ThreadSafeSender> sender,
125 int host_routing_id, 126 int host_routing_id,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 browser_plugin_->browser_plugin_instance_id()); 178 browser_plugin_->browser_plugin_instance_id());
178 cc::SurfaceLayer::RequireCallback require_callback = 179 cc::SurfaceLayer::RequireCallback require_callback =
179 render_frame_proxy_ 180 render_frame_proxy_
180 ? base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender, 181 ? base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender,
181 host_routing_id_) 182 host_routing_id_)
182 : base::Bind( 183 : base::Bind(
183 &ChildFrameCompositingHelper::RequireCallbackBrowserPlugin, 184 &ChildFrameCompositingHelper::RequireCallbackBrowserPlugin,
184 sender, host_routing_id_, 185 sender, host_routing_id_,
185 browser_plugin_->browser_plugin_instance_id()); 186 browser_plugin_->browser_plugin_instance_id());
186 scoped_refptr<cc::SurfaceLayer> surface_layer = 187 scoped_refptr<cc::SurfaceLayer> surface_layer =
187 cc::SurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), 188 cc::SurfaceLayer::Create(cc::LayerSettings(),
188 satisfy_callback, require_callback); 189 satisfy_callback, require_callback);
189 // TODO(oshima): This is a stopgap fix so that the compositor does not 190 // TODO(oshima): This is a stopgap fix so that the compositor does not
190 // scaledown the content when 2x frame data is added to 1x parent frame data. 191 // scaledown the content when 2x frame data is added to 1x parent frame data.
191 // Fix this in cc/. 192 // Fix this in cc/.
192 if (IsUseZoomForDSFEnabled()) 193 if (IsUseZoomForDSFEnabled())
193 scale_factor = 1.0f; 194 scale_factor = 1.0f;
194 195
195 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size); 196 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size);
196 surface_layer->SetMasksToBounds(true); 197 surface_layer->SetMasksToBounds(true);
197 blink::WebLayer* layer = new cc_blink::WebLayerImpl(surface_layer); 198 blink::WebLayer* layer = new cc_blink::WebLayerImpl(surface_layer);
(...skipping 16 matching lines...) Expand all
214 frame_size, scale_factor, 215 frame_size, scale_factor,
215 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); 216 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer());
216 } 217 }
217 218
218 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { 219 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) {
219 if (web_layer_) 220 if (web_layer_)
220 web_layer_->setDrawsContent(visible); 221 web_layer_->setDrawsContent(visible);
221 } 222 }
222 223
223 } // namespace content 224 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698