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

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

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Fix PaintControllerTest v2 Created 3 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
« no previous file with comments | « no previous file | cc/paint/paint_canvas.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 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/layers/picture_layer_impl.h" 9 #include "cc/layers/picture_layer_impl.h"
10 #include "cc/paint/drawing_display_item.h" 10 #include "cc/paint/drawing_display_item.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 SkScalar content_to_layer_scale_x = 69 SkScalar content_to_layer_scale_x =
70 SkFloatToScalar(static_cast<float>(bounds().width()) / image_->width()); 70 SkFloatToScalar(static_cast<float>(bounds().width()) / image_->width());
71 SkScalar content_to_layer_scale_y = 71 SkScalar content_to_layer_scale_y =
72 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); 72 SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height());
73 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); 73 canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y);
74 74
75 // Because Android WebView resourceless software draw mode rasters directly 75 // Because Android WebView resourceless software draw mode rasters directly
76 // to the root canvas, this draw must use the kSrcOver_Mode so that 76 // to the root canvas, this draw must use the kSrcOver_Mode so that
77 // transparent images blend correctly. 77 // transparent images blend correctly.
78 canvas->drawImage(image_.get(), 0, 0); 78 canvas->drawImage(image_, 0, 0);
79 79
80 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( 80 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>(
81 PaintableRegion(), recorder.finishRecordingAsPicture()); 81 PaintableRegion(), recorder.finishRecordingAsPicture());
82 82
83 display_list->Finalize(); 83 display_list->Finalize();
84 return display_list; 84 return display_list;
85 } 85 }
86 86
87 bool PictureImageLayer::FillsBoundsCompletely() const { 87 bool PictureImageLayer::FillsBoundsCompletely() const {
88 return false; 88 return false;
89 } 89 }
90 90
91 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { 91 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const {
92 return 0; 92 return 0;
93 } 93 }
94 94
95 } // namespace cc 95 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/paint/paint_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698