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

Side by Side Diff: cc/layers/picture_image_layer.cc

Issue 565043002: cc: Remove the opaque rect return-parameter from ContentLayerClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contentlayerclientopaque: build Created 6 years, 3 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/layers/picture_image_layer.h ('k') | cc/layers/picture_layer.cc » ('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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 "cc/layers/picture_image_layer.h" 5 #include "cc/layers/picture_image_layer.h"
6 6
7 #include "cc/layers/picture_image_layer_impl.h" 7 #include "cc/layers/picture_image_layer_impl.h"
8 #include "third_party/skia/include/core/SkCanvas.h" 8 #include "third_party/skia/include/core/SkCanvas.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 26 matching lines...) Expand all
37 return; 37 return;
38 38
39 bitmap_ = bitmap; 39 bitmap_ = bitmap;
40 UpdateDrawsContent(HasDrawableContent()); 40 UpdateDrawsContent(HasDrawableContent());
41 SetNeedsDisplay(); 41 SetNeedsDisplay();
42 } 42 }
43 43
44 void PictureImageLayer::PaintContents( 44 void PictureImageLayer::PaintContents(
45 SkCanvas* canvas, 45 SkCanvas* canvas,
46 const gfx::Rect& clip, 46 const gfx::Rect& clip,
47 gfx::RectF* opaque,
48 ContentLayerClient::GraphicsContextStatus gc_status) { 47 ContentLayerClient::GraphicsContextStatus gc_status) {
49 if (!bitmap_.width() || !bitmap_.height()) 48 if (!bitmap_.width() || !bitmap_.height())
50 return; 49 return;
51 50
52 SkScalar content_to_layer_scale_x = 51 SkScalar content_to_layer_scale_x =
53 SkFloatToScalar(static_cast<float>(bounds().width()) / bitmap_.width()); 52 SkFloatToScalar(static_cast<float>(bounds().width()) / bitmap_.width());
54 SkScalar content_to_layer_scale_y = 53 SkScalar content_to_layer_scale_y =
55 SkFloatToScalar(static_cast<float>(bounds().height()) / bitmap_.height()); 54 SkFloatToScalar(static_cast<float>(bounds().height()) / bitmap_.height());
56 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); 55 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y);
57 56
58 // Because Android WebView resourceless software draw mode rasters directly 57 // Because Android WebView resourceless software draw mode rasters directly
59 // to the root canvas, this draw must use the kSrcOver_Mode so that 58 // to the root canvas, this draw must use the kSrcOver_Mode so that
60 // transparent images blend correctly. 59 // transparent images blend correctly.
61 canvas->drawBitmap(bitmap_, 0, 0); 60 canvas->drawBitmap(bitmap_, 0, 0);
62 } 61 }
63 62
64 bool PictureImageLayer::FillsBoundsCompletely() const { 63 bool PictureImageLayer::FillsBoundsCompletely() const {
65 return false; 64 return false;
66 } 65 }
67 66
68 } // namespace cc 67 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_image_layer.h ('k') | cc/layers/picture_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698