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

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

Issue 2873003002: Add stable id to PaintImage. (Closed)
Patch Set: rebase 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(SkImage::MakeFromBitmap(*sad_bitmap))); 195 sad_layer->SetImage(cc::PaintImage(cc::PaintImage::kNonLazyStableId,
196 SkImage::MakeFromBitmap(*sad_bitmap)));
196 sad_layer->SetBounds( 197 sad_layer->SetBounds(
197 gfx::Size(sad_bitmap->width(), sad_bitmap->height())); 198 gfx::Size(sad_bitmap->width(), sad_bitmap->height()));
198 sad_layer->SetPosition(gfx::PointF( 199 sad_layer->SetPosition(gfx::PointF(
199 (web_layer_->Bounds().width - sad_bitmap->width()) / 2, 200 (web_layer_->Bounds().width - sad_bitmap->width()) / 2,
200 (web_layer_->Bounds().height - sad_bitmap->height()) / 2)); 201 (web_layer_->Bounds().height - sad_bitmap->height()) / 2));
201 sad_layer->SetIsDrawable(true); 202 sad_layer->SetIsDrawable(true);
202 203
203 crashed_layer->AddChild(sad_layer); 204 crashed_layer->AddChild(sad_layer);
204 } 205 }
205 } 206 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 surface_info.size_in_pixels(), surface_info.device_scale_factor(), 251 surface_info.size_in_pixels(), surface_info.device_scale_factor(),
251 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); 252 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer());
252 } 253 }
253 254
254 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { 255 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) {
255 if (web_layer_) 256 if (web_layer_)
256 web_layer_->SetDrawsContent(visible); 257 web_layer_->SetDrawsContent(visible);
257 } 258 }
258 259
259 } // namespace content 260 } // 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