Chromium Code Reviews| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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); | |
|
enne (OOO)
2013/05/13 19:33:10
This moved to PicturePileImpl::RasterToBitmap.
| |
| 204 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), | 201 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), |
| 205 layer_rect_.y(), | 202 layer_rect_.y(), |
| 206 layer_rect_.width(), | 203 layer_rect_.width(), |
| 207 layer_rect_.height()); | 204 layer_rect_.height()); |
| 208 canvas->clipRect(layer_skrect); | 205 canvas->clipRect(layer_skrect); |
| 209 canvas->drawRect(layer_skrect, paint); | |
| 210 | 206 |
| 211 gfx::RectF opaque_layer_rect; | 207 gfx::RectF opaque_layer_rect; |
| 212 base::TimeTicks begin_record_time; | 208 base::TimeTicks begin_record_time; |
| 213 if (stats) | 209 if (stats) |
| 214 begin_record_time = base::TimeTicks::Now(); | 210 begin_record_time = base::TimeTicks::Now(); |
| 215 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); | 211 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); |
| 216 if (stats) { | 212 if (stats) { |
| 217 stats->total_record_time += base::TimeTicks::Now() - begin_record_time; | 213 stats->total_record_time += base::TimeTicks::Now() - begin_record_time; |
| 218 stats->total_pixels_recorded += | 214 stats->total_pixels_recorded += |
| 219 layer_rect_.width() * layer_rect_.height(); | 215 layer_rect_.width() * layer_rect_.height(); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 | 423 |
| 428 // We found a non-empty list: store it and get the first pixel ref. | 424 // We found a non-empty list: store it and get the first pixel ref. |
| 429 current_pixel_refs_ = &iter->second; | 425 current_pixel_refs_ = &iter->second; |
| 430 current_index_ = 0; | 426 current_index_ = 0; |
| 431 break; | 427 break; |
| 432 } | 428 } |
| 433 return *this; | 429 return *this; |
| 434 } | 430 } |
| 435 | 431 |
| 436 } // namespace cc | 432 } // namespace cc |
| OLD | NEW |