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

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

Issue 14322017: Revert "cc: Move canvas clear from picture to picture_pile_impl" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert Created 7 years, 7 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/resources/picture_pile_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture.h" 5 #include "cc/resources/picture.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 SkCanvas* canvas = picture_->beginRecording( 191 SkCanvas* canvas = picture_->beginRecording(
192 layer_rect_.width(), 192 layer_rect_.width(),
193 layer_rect_.height(), 193 layer_rect_.height(),
194 SkPicture::kUsePathBoundsForClip_RecordingFlag | 194 SkPicture::kUsePathBoundsForClip_RecordingFlag |
195 SkPicture::kOptimizeForClippedPlayback_RecordingFlag); 195 SkPicture::kOptimizeForClippedPlayback_RecordingFlag);
196 196
197 canvas->save(); 197 canvas->save();
198 canvas->translate(SkFloatToScalar(-layer_rect_.x()), 198 canvas->translate(SkFloatToScalar(-layer_rect_.x()),
199 SkFloatToScalar(-layer_rect_.y())); 199 SkFloatToScalar(-layer_rect_.y()));
200 200
201 SkPaint paint;
202 paint.setAntiAlias(false);
203 paint.setXfermodeMode(SkXfermode::kClear_Mode);
204 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(),
205 layer_rect_.y(),
206 layer_rect_.width(),
207 layer_rect_.height());
208 canvas->clipRect(layer_skrect);
209 canvas->drawRect(layer_skrect, paint);
210
201 gfx::RectF opaque_layer_rect; 211 gfx::RectF opaque_layer_rect;
202 base::TimeTicks begin_record_time; 212 base::TimeTicks begin_record_time;
203 if (stats) 213 if (stats)
204 begin_record_time = base::TimeTicks::Now(); 214 begin_record_time = base::TimeTicks::Now();
205 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); 215 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect);
206 if (stats) { 216 if (stats) {
207 stats->total_record_time += base::TimeTicks::Now() - begin_record_time; 217 stats->total_record_time += base::TimeTicks::Now() - begin_record_time;
208 stats->total_pixels_recorded += 218 stats->total_pixels_recorded +=
209 layer_rect_.width() * layer_rect_.height(); 219 layer_rect_.width() * layer_rect_.height();
210 } 220 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 427
418 // We found a non-empty list: store it and get the first pixel ref. 428 // We found a non-empty list: store it and get the first pixel ref.
419 current_pixel_refs_ = &iter->second; 429 current_pixel_refs_ = &iter->second;
420 current_index_ = 0; 430 current_index_ = 0;
421 break; 431 break;
422 } 432 }
423 return *this; 433 return *this;
424 } 434 }
425 435
426 } // namespace cc 436 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698