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

Side by Side Diff: content/renderer/child_frame_compositing_helper.cc

Issue 2880813002: Revert of Add stable id to PaintImage. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_masks.cc ('k') | media/renderers/skcanvas_video_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/picture_image_layer.h" 10 #include "cc/layers/picture_image_layer.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 crashed_layer->SetMasksToBounds(true); 185 crashed_layer->SetMasksToBounds(true);
186 crashed_layer->SetBackgroundColor(SK_ColorBLACK); 186 crashed_layer->SetBackgroundColor(SK_ColorBLACK);
187 187
188 if (web_layer_) { 188 if (web_layer_) {
189 SkBitmap* sad_bitmap = 189 SkBitmap* sad_bitmap =
190 GetContentClient()->renderer()->GetSadWebViewBitmap(); 190 GetContentClient()->renderer()->GetSadWebViewBitmap();
191 if (sad_bitmap && web_layer_->Bounds().width > sad_bitmap->width() && 191 if (sad_bitmap && web_layer_->Bounds().width > sad_bitmap->width() &&
192 web_layer_->Bounds().height > sad_bitmap->height()) { 192 web_layer_->Bounds().height > sad_bitmap->height()) {
193 scoped_refptr<cc::PictureImageLayer> sad_layer = 193 scoped_refptr<cc::PictureImageLayer> sad_layer =
194 cc::PictureImageLayer::Create(); 194 cc::PictureImageLayer::Create();
195 sad_layer->SetImage(cc::PaintImage(cc::PaintImage::kNonLazyStableId, 195 sad_layer->SetImage(cc::PaintImage(SkImage::MakeFromBitmap(*sad_bitmap)));
196 SkImage::MakeFromBitmap(*sad_bitmap)));
197 sad_layer->SetBounds( 196 sad_layer->SetBounds(
198 gfx::Size(sad_bitmap->width(), sad_bitmap->height())); 197 gfx::Size(sad_bitmap->width(), sad_bitmap->height()));
199 sad_layer->SetPosition(gfx::PointF( 198 sad_layer->SetPosition(gfx::PointF(
200 (web_layer_->Bounds().width - sad_bitmap->width()) / 2, 199 (web_layer_->Bounds().width - sad_bitmap->width()) / 2,
201 (web_layer_->Bounds().height - sad_bitmap->height()) / 2)); 200 (web_layer_->Bounds().height - sad_bitmap->height()) / 2));
202 sad_layer->SetIsDrawable(true); 201 sad_layer->SetIsDrawable(true);
203 202
204 crashed_layer->AddChild(sad_layer); 203 crashed_layer->AddChild(sad_layer);
205 } 204 }
206 } 205 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 surface_info.size_in_pixels(), surface_info.device_scale_factor(), 250 surface_info.size_in_pixels(), surface_info.device_scale_factor(),
252 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); 251 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer());
253 } 252 }
254 253
255 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { 254 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) {
256 if (web_layer_) 255 if (web_layer_)
257 web_layer_->SetDrawsContent(visible); 256 web_layer_->SetDrawsContent(visible);
258 } 257 }
259 258
260 } // namespace content 259 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_masks.cc ('k') | media/renderers/skcanvas_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698