| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/gpu_rasterizer.h" | 5 #include "cc/resources/gpu_rasterizer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 bool use_distance_field_text = | 113 bool use_distance_field_text = |
| 114 use_distance_field_text_ || | 114 use_distance_field_text_ || |
| 115 raster_source->ShouldAttemptToUseDistanceFieldText(); | 115 raster_source->ShouldAttemptToUseDistanceFieldText(); |
| 116 | 116 |
| 117 // Playback picture into resource. | 117 // Playback picture into resource. |
| 118 { | 118 { |
| 119 ScopedGpuRaster gpu_raster(GetContextProvider(use_worker_context)); | 119 ScopedGpuRaster gpu_raster(GetContextProvider(use_worker_context)); |
| 120 write_lock->InitSkSurface(use_worker_context, use_distance_field_text, | 120 write_lock->InitSkSurface(use_worker_context, use_distance_field_text, |
| 121 raster_source->CanUseLCDText(), | 121 raster_source->CanUseLCDText(), |
| 122 msaa_sample_count_); | 122 msaa_sample_count_); |
| 123 picture->playback(write_lock->sk_surface()->getCanvas(), nullptr); | 123 SkMultiPictureDraw multi_picture_draw; |
| 124 multi_picture_draw.add(write_lock->sk_surface()->getCanvas(), |
| 125 picture.get()); |
| 126 multi_picture_draw.draw(false); |
| 124 write_lock->ReleaseSkSurface(); | 127 write_lock->ReleaseSkSurface(); |
| 125 } | 128 } |
| 126 } | 129 } |
| 127 | 130 |
| 128 void GpuRasterizer::PerformSolidColorAnalysis( | 131 void GpuRasterizer::PerformSolidColorAnalysis( |
| 129 const Tile* tile, | 132 const Tile* tile, |
| 130 RasterSource::SolidColorAnalysis* analysis) { | 133 RasterSource::SolidColorAnalysis* analysis) { |
| 131 const void* tile_id = static_cast<const void*>(tile); | 134 const void* tile_id = static_cast<const void*>(tile); |
| 132 frame_viewer_instrumentation::ScopedAnalyzeTask analyze_task( | 135 frame_viewer_instrumentation::ScopedAnalyzeTask analyze_task( |
| 133 tile_id, tile->combined_priority().resolution, | 136 tile_id, tile->combined_priority().resolution, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(), | 185 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(), |
| 183 tile->contents_scale()); | 186 tile->contents_scale()); |
| 184 canvas->restore(); | 187 canvas->restore(); |
| 185 | 188 |
| 186 // Add the canvas and recorded picture to |multi_picture_draw_|. | 189 // Add the canvas and recorded picture to |multi_picture_draw_|. |
| 187 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); | 190 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); |
| 188 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get()); | 191 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get()); |
| 189 } | 192 } |
| 190 | 193 |
| 191 } // namespace cc | 194 } // namespace cc |
| OLD | NEW |