OLD | NEW |
---|---|
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 SkCanvas* canvas = picture_->beginRecording( | 160 SkCanvas* canvas = picture_->beginRecording( |
161 layer_rect_.width(), | 161 layer_rect_.width(), |
162 layer_rect_.height(), | 162 layer_rect_.height(), |
163 SkPicture::kUsePathBoundsForClip_RecordingFlag | | 163 SkPicture::kUsePathBoundsForClip_RecordingFlag | |
164 SkPicture::kOptimizeForClippedPlayback_RecordingFlag); | 164 SkPicture::kOptimizeForClippedPlayback_RecordingFlag); |
165 | 165 |
166 canvas->save(); | 166 canvas->save(); |
167 canvas->translate(SkFloatToScalar(-layer_rect_.x()), | 167 canvas->translate(SkFloatToScalar(-layer_rect_.x()), |
168 SkFloatToScalar(-layer_rect_.y())); | 168 SkFloatToScalar(-layer_rect_.y())); |
169 | 169 |
170 SkPaint paint; | |
171 paint.setAntiAlias(false); | |
172 paint.setXfermodeMode(SkXfermode::kClear_Mode); | |
173 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), | 170 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), |
enne (OOO)
2013/04/29 18:23:35
While you're here, can you change this to RectToSk
| |
174 layer_rect_.y(), | 171 layer_rect_.y(), |
175 layer_rect_.width(), | 172 layer_rect_.width(), |
176 layer_rect_.height()); | 173 layer_rect_.height()); |
177 canvas->clipRect(layer_skrect); | 174 canvas->clipRect(layer_skrect); |
178 canvas->drawRect(layer_skrect, paint); | |
179 | 175 |
180 gfx::RectF opaque_layer_rect; | 176 gfx::RectF opaque_layer_rect; |
181 base::TimeTicks begin_record_time; | 177 base::TimeTicks begin_record_time; |
182 if (stats) | 178 if (stats) |
183 begin_record_time = base::TimeTicks::Now(); | 179 begin_record_time = base::TimeTicks::Now(); |
184 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); | 180 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); |
185 if (stats) { | 181 if (stats) { |
186 stats->total_record_time += base::TimeTicks::Now() - begin_record_time; | 182 stats->total_record_time += base::TimeTicks::Now() - begin_record_time; |
187 stats->total_pixels_recorded += | 183 stats->total_pixels_recorded += |
188 layer_rect_.width() * layer_rect_.height(); | 184 layer_rect_.width() * layer_rect_.height(); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 | 409 |
414 // We found a non-empty list: store it and get the first pixel ref. | 410 // We found a non-empty list: store it and get the first pixel ref. |
415 current_pixel_refs_ = &iter->second; | 411 current_pixel_refs_ = &iter->second; |
416 current_index_ = 0; | 412 current_index_ = 0; |
417 break; | 413 break; |
418 } | 414 } |
419 return *this; | 415 return *this; |
420 } | 416 } |
421 | 417 |
422 } // namespace cc | 418 } // namespace cc |
OLD | NEW |