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

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

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/quads/tile_draw_quad.cc ('k') | cc/resources/eviction_tile_priority_queue.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 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 void DisplayListRecordingSource::DetermineIfSolidColor() { 137 void DisplayListRecordingSource::DetermineIfSolidColor() {
138 DCHECK(display_list_.get()); 138 DCHECK(display_list_.get());
139 is_solid_color_ = false; 139 is_solid_color_ = false;
140 solid_color_ = SK_ColorTRANSPARENT; 140 solid_color_ = SK_ColorTRANSPARENT;
141 141
142 if (display_list_->ApproximateOpCount() > kOpCountThatIsOkToAnalyze) 142 if (display_list_->ApproximateOpCount() > kOpCountThatIsOkToAnalyze)
143 return; 143 return;
144 144
145 skia::AnalysisCanvas canvas(recorded_viewport_.width(), 145 gfx::Size layer_size = GetSize();
146 recorded_viewport_.height()); 146 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height());
147 canvas.translate(-recorded_viewport_.x(), -recorded_viewport_.y());
148 display_list_->Raster(&canvas, nullptr, 1.f); 147 display_list_->Raster(&canvas, nullptr, 1.f);
149 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); 148 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_);
150 } 149 }
151 150
152 void DisplayListRecordingSource::Clear() { 151 void DisplayListRecordingSource::Clear() {
153 recorded_viewport_ = gfx::Rect(); 152 recorded_viewport_ = gfx::Rect();
154 display_list_ = NULL; 153 display_list_ = NULL;
155 is_solid_color_ = false; 154 is_solid_color_ = false;
156 } 155 }
157 156
158 } // namespace cc 157 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/tile_draw_quad.cc ('k') | cc/resources/eviction_tile_priority_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698