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

Side by Side Diff: cc/resources/content_layer_updater.cc

Issue 684653004: Plumb can_use_lcd_text, contents_opaque directly to ContentLayerClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/resources/content_layer_updater.h" 5 #include "cc/resources/content_layer_updater.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/debug/rendering_stats_instrumentation.h" 8 #include "cc/debug/rendering_stats_instrumentation.h"
9 #include "cc/resources/layer_painter.h" 9 #include "cc/resources/layer_painter.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 canvas->clipRect(layer_sk_rect); 100 canvas->clipRect(layer_sk_rect);
101 101
102 // If the layer has opaque contents or will fill the bounds completely there 102 // If the layer has opaque contents or will fill the bounds completely there
103 // is no need to clear the canvas before painting. 103 // is no need to clear the canvas before painting.
104 if (!layer_is_opaque_ && !layer_fills_bounds_completely_) { 104 if (!layer_is_opaque_ && !layer_fills_bounds_completely_) {
105 TRACE_EVENT0("cc", "Clear"); 105 TRACE_EVENT0("cc", "Clear");
106 canvas->drawColor(SK_ColorTRANSPARENT, SkXfermode::kSrc_Mode); 106 canvas->drawColor(SK_ColorTRANSPARENT, SkXfermode::kSrc_Mode);
107 } 107 }
108 108
109 painter_->Paint(canvas, layer_rect); 109 painter_->Paint(
110 canvas, layer_rect, layer_can_use_lcd_text_, layer_is_opaque_);
110 canvas->restore(); 111 canvas->restore();
111 112
112 paint_rect_ = paint_rect; 113 paint_rect_ = paint_rect;
113 } 114 }
114 115
115 void ContentLayerUpdater::SetOpaque(bool opaque) { 116 void ContentLayerUpdater::SetOpaque(bool opaque) {
116 layer_is_opaque_ = opaque; 117 layer_is_opaque_ = opaque;
117 } 118 }
118 119
120 void ContentLayerUpdater::SetCanUseLCDText(bool can_use_lcd_text) {
121 layer_can_use_lcd_text_ = can_use_lcd_text;
122 }
123
119 void ContentLayerUpdater::SetFillsBoundsCompletely(bool fills_bounds) { 124 void ContentLayerUpdater::SetFillsBoundsCompletely(bool fills_bounds) {
120 layer_fills_bounds_completely_ = fills_bounds; 125 layer_fills_bounds_completely_ = fills_bounds;
121 } 126 }
122 127
123 void ContentLayerUpdater::SetBackgroundColor(SkColor background_color) { 128 void ContentLayerUpdater::SetBackgroundColor(SkColor background_color) {
124 background_color_ = background_color; 129 background_color_ = background_color;
125 } 130 }
126 131
127 } // namespace cc 132 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698