| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 scoped_ptr<ScopedResource> resource; | 77 scoped_ptr<ScopedResource> resource; |
| 78 if (!analysis.is_solid_color) { | 78 if (!analysis.is_solid_color) { |
| 79 resource = resource_pool->AcquireResource(tile->desired_texture_size(), | 79 resource = resource_pool->AcquireResource(tile->desired_texture_size(), |
| 80 resource_format); | 80 resource_format); |
| 81 AddToMultiPictureDraw(tile, resource.get(), &locks); | 81 AddToMultiPictureDraw(tile, resource.get(), &locks); |
| 82 } | 82 } |
| 83 update_tile_draw_info.Run(tile, resource.Pass(), analysis); | 83 update_tile_draw_info.Run(tile, resource.Pass(), analysis); |
| 84 } | 84 } |
| 85 | 85 |
| 86 multi_picture_draw_.draw(); | 86 // If MSAA is enabled, tell Skia to resolve each render target after draw. |
| 87 multi_picture_draw_.draw(msaa_sample_count_ > 0); |
| 87 } | 88 } |
| 88 | 89 |
| 89 void GpuRasterizer::PerformSolidColorAnalysis( | 90 void GpuRasterizer::PerformSolidColorAnalysis( |
| 90 const Tile* tile, | 91 const Tile* tile, |
| 91 RasterSource::SolidColorAnalysis* analysis) { | 92 RasterSource::SolidColorAnalysis* analysis) { |
| 92 const void* tile_id = static_cast<const void*>(tile); | 93 const void* tile_id = static_cast<const void*>(tile); |
| 93 frame_viewer_instrumentation::ScopedAnalyzeTask analyze_task( | 94 frame_viewer_instrumentation::ScopedAnalyzeTask analyze_task( |
| 94 tile_id, tile->combined_priority().resolution, | 95 tile_id, tile->combined_priority().resolution, |
| 95 tile->source_frame_number(), tile->layer_id()); | 96 tile->source_frame_number(), tile->layer_id()); |
| 96 | 97 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(), | 141 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(), |
| 141 tile->contents_scale()); | 142 tile->contents_scale()); |
| 142 canvas->restore(); | 143 canvas->restore(); |
| 143 | 144 |
| 144 // Add the canvas and recorded picture to |multi_picture_draw_|. | 145 // Add the canvas and recorded picture to |multi_picture_draw_|. |
| 145 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); | 146 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); |
| 146 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get()); | 147 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get()); |
| 147 } | 148 } |
| 148 | 149 |
| 149 } // namespace cc | 150 } // namespace cc |
| OLD | NEW |