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

Side by Side Diff: cc/playback/recording_source.cc

Issue 1864603003: Remove redundant layer size check in RecordingSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/playback/recording_source.h" 5 #include "cc/playback/recording_source.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 bool RecordingSource::UpdateAndExpandInvalidation( 130 bool RecordingSource::UpdateAndExpandInvalidation(
131 ContentLayerClient* painter, 131 ContentLayerClient* painter,
132 Region* invalidation, 132 Region* invalidation,
133 const gfx::Size& layer_size, 133 const gfx::Size& layer_size,
134 int frame_number, 134 int frame_number,
135 RecordingMode recording_mode) { 135 RecordingMode recording_mode) {
136 ScopedRecordingSourceUpdateTimer timer; 136 ScopedRecordingSourceUpdateTimer timer;
137 bool updated = false; 137 bool updated = false;
138 138
139 // TODO(chrishtr): delete this conditional once synchronized paint launches. 139 if (size_ != layer_size)
140 if (size_ != layer_size) {
141 size_ = layer_size; 140 size_ = layer_size;
142 updated = true;
143 }
144 141
145 invalidation_.Swap(invalidation); 142 invalidation_.Swap(invalidation);
146 invalidation_.Clear(); 143 invalidation_.Clear();
147 144
148 gfx::Rect new_recorded_viewport = painter->PaintableRegion(); 145 gfx::Rect new_recorded_viewport = painter->PaintableRegion();
149 if (new_recorded_viewport != recorded_viewport_) { 146 if (new_recorded_viewport != recorded_viewport_) {
150 UpdateInvalidationForNewViewport(recorded_viewport_, new_recorded_viewport, 147 UpdateInvalidationForNewViewport(recorded_viewport_, new_recorded_viewport,
151 invalidation); 148 invalidation);
152 recorded_viewport_ = new_recorded_viewport; 149 recorded_viewport_ = new_recorded_viewport;
153 updated = true; 150 updated = true;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 251 }
255 252
256 void RecordingSource::Clear() { 253 void RecordingSource::Clear() {
257 recorded_viewport_ = gfx::Rect(); 254 recorded_viewport_ = gfx::Rect();
258 display_list_ = nullptr; 255 display_list_ = nullptr;
259 painter_reported_memory_usage_ = 0; 256 painter_reported_memory_usage_ = 0;
260 is_solid_color_ = false; 257 is_solid_color_ = false;
261 } 258 }
262 259
263 } // namespace cc 260 } // 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