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

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

Issue 862773002: Do full layer recording in slimming paint mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | no next file » | 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 "cc/resources/display_list_recording_source.h" 5 #include "cc/resources/display_list_recording_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/base/region.h" 9 #include "cc/base/region.h"
10 #include "cc/layers/content_layer_client.h" 10 #include "cc/layers/content_layer_client.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 updated = true; 53 updated = true;
54 } 54 }
55 55
56 if (can_use_lcd_text_ != can_use_lcd_text) { 56 if (can_use_lcd_text_ != can_use_lcd_text) {
57 can_use_lcd_text_ = can_use_lcd_text; 57 can_use_lcd_text_ = can_use_lcd_text;
58 invalidation->Union(gfx::Rect(GetSize())); 58 invalidation->Union(gfx::Rect(GetSize()));
59 updated = true; 59 updated = true;
60 } 60 }
61 61
62 gfx::Rect old_recorded_viewport = recorded_viewport_; 62 gfx::Rect old_recorded_viewport = recorded_viewport_;
63 #if 1
64 // TODO(wangxianzhu): Blink slimming paint doesn't support incremental
65 // painting for now so we must record for the whole layer. Should measure
66 // performance and determine the best choice. Consider display item caching.
67 recorded_viewport_ = gfx::Rect(GetSize());
68 #else
63 recorded_viewport_ = visible_layer_rect; 69 recorded_viewport_ = visible_layer_rect;
64 recorded_viewport_.Inset(-pixel_record_distance_, -pixel_record_distance_); 70 recorded_viewport_.Inset(-pixel_record_distance_, -pixel_record_distance_);
65 recorded_viewport_.Intersect(gfx::Rect(GetSize())); 71 recorded_viewport_.Intersect(gfx::Rect(GetSize()));
72 #endif
ajuma 2015/01/20 22:19:35 Let's remove this code for now instead of #if-ing
Xianzhu 2015/01/20 22:24:27 Done.
66 73
67 if (recorded_viewport_ != old_recorded_viewport) { 74 if (recorded_viewport_ != old_recorded_viewport) {
68 // Invalidate newly-exposed and no-longer-exposed areas. 75 // Invalidate newly-exposed and no-longer-exposed areas.
69 Region newly_exposed_region(recorded_viewport_); 76 Region newly_exposed_region(recorded_viewport_);
70 newly_exposed_region.Subtract(old_recorded_viewport); 77 newly_exposed_region.Subtract(old_recorded_viewport);
71 invalidation->Union(newly_exposed_region); 78 invalidation->Union(newly_exposed_region);
72 79
73 Region no_longer_exposed_region(old_recorded_viewport); 80 Region no_longer_exposed_region(old_recorded_viewport);
74 no_longer_exposed_region.Subtract(recorded_viewport_); 81 no_longer_exposed_region.Subtract(recorded_viewport_);
75 invalidation->Union(no_longer_exposed_region); 82 invalidation->Union(no_longer_exposed_region);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); 156 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_);
150 } 157 }
151 158
152 void DisplayListRecordingSource::Clear() { 159 void DisplayListRecordingSource::Clear() {
153 recorded_viewport_ = gfx::Rect(); 160 recorded_viewport_ = gfx::Rect();
154 display_list_ = NULL; 161 display_list_ = NULL;
155 is_solid_color_ = false; 162 is_solid_color_ = false;
156 } 163 }
157 164
158 } // namespace cc 165 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698