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/output/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 SkScalarRoundToInt(quad->shared_quad_state->opacity * 255) < 255; | 332 SkScalarRoundToInt(quad->shared_quad_state->opacity * 255) < 255; |
333 const bool disable_image_filtering = | 333 const bool disable_image_filtering = |
334 disable_picture_quad_image_filtering_ || quad->nearest_neighbor; | 334 disable_picture_quad_image_filtering_ || quad->nearest_neighbor; |
335 | 335 |
336 TRACE_EVENT0("cc", "SoftwareRenderer::DrawPictureQuad"); | 336 TRACE_EVENT0("cc", "SoftwareRenderer::DrawPictureQuad"); |
337 | 337 |
338 RasterSource::PlaybackSettings playback_settings; | 338 RasterSource::PlaybackSettings playback_settings; |
339 playback_settings.playback_to_shared_canvas = true; | 339 playback_settings.playback_to_shared_canvas = true; |
340 // Indicates whether content rasterization should happen through an | 340 // Indicates whether content rasterization should happen through an |
341 // ImageHijackCanvas, which causes image decodes to be managed by an | 341 // ImageHijackCanvas, which causes image decodes to be managed by an |
342 // ImageDecodeController. PictureDrawQuads are used for resourceless software | 342 // ImageDecodeCache. PictureDrawQuads are used for resourceless software |
343 // draws, while a GPU ImageDecodeController may be in use by the compositor | 343 // draws, while a GPU ImageDecodeCache may be in use by the compositor |
344 // providing the RasterSource. So we disable the image hijack canvas to avoid | 344 // providing the RasterSource. So we disable the image hijack canvas to avoid |
345 // trying to use the GPU ImageDecodeController while doing a software draw. | 345 // trying to use the GPU ImageDecodeCache while doing a software draw. |
346 playback_settings.use_image_hijack_canvas = false; | 346 playback_settings.use_image_hijack_canvas = false; |
347 if (needs_transparency || disable_image_filtering) { | 347 if (needs_transparency || disable_image_filtering) { |
348 // TODO(aelias): This isn't correct in all cases. We should detect these | 348 // TODO(aelias): This isn't correct in all cases. We should detect these |
349 // cases and fall back to a persistent bitmap backing | 349 // cases and fall back to a persistent bitmap backing |
350 // (http://crbug.com/280374). | 350 // (http://crbug.com/280374). |
351 // TODO(vmpstr): Fold this canvas into playback and have raster source | 351 // TODO(vmpstr): Fold this canvas into playback and have raster source |
352 // accept a set of settings on playback that will determine which canvas to | 352 // accept a set of settings on playback that will determine which canvas to |
353 // apply. (http://crbug.com/594679) | 353 // apply. (http://crbug.com/594679) |
354 skia::OpacityFilterCanvas filtered_canvas(current_canvas_, | 354 skia::OpacityFilterCanvas filtered_canvas(current_canvas_, |
355 quad->shared_quad_state->opacity, | 355 quad->shared_quad_state->opacity, |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); | 713 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); |
714 | 714 |
715 if (!filter_backdrop_image) | 715 if (!filter_backdrop_image) |
716 return nullptr; | 716 return nullptr; |
717 | 717 |
718 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, | 718 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, |
719 &filter_backdrop_transform); | 719 &filter_backdrop_transform); |
720 } | 720 } |
721 | 721 |
722 } // namespace cc | 722 } // namespace cc |
OLD | NEW |