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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
430 SkMatrix::kFill_ScaleToFit); | 430 SkMatrix::kFill_ScaleToFit); |
431 | 431 |
432 const SkBitmap* content = lock.sk_bitmap(); | 432 const SkBitmap* content = lock.sk_bitmap(); |
433 skia::RefPtr<SkShader> shader = skia::AdoptRef( | 433 skia::RefPtr<SkShader> shader = skia::AdoptRef( |
434 SkShader::CreateBitmapShader(*content, | 434 SkShader::CreateBitmapShader(*content, |
435 SkShader::kClamp_TileMode, | 435 SkShader::kClamp_TileMode, |
436 SkShader::kClamp_TileMode)); | 436 SkShader::kClamp_TileMode)); |
437 shader->setLocalMatrix(content_mat); | 437 shader->setLocalMatrix(content_mat); |
438 current_paint_.setShader(shader.get()); | 438 current_paint_.setShader(shader.get()); |
439 | 439 |
440 // TODO(ajuma): Remove this condition once general CSS filters are working | 440 if (!quad->filters.IsEmpty()) { |
441 // correctly (http://crbug.com/160302), and add corresponding pixel tests. | |
442 if (quad->filters.HasReferenceFilter()) { | |
443 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( | 441 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( |
444 quad->filters, content_texture->size()); | 442 quad->filters, content_texture->size()); |
443 // TODO(ajuma): Pass the quad's rect origin when applying the filter. | |
ajuma
2013/09/11 15:59:45
This is why ImageFilterClipped pixel test doesn't
Stephen White
2013/09/11 16:48:06
It should just be a matter of getting the correct
slavi
2013/09/13 18:53:20
AFAIK (I wrote the code) masks + filters do work c
ajuma
2013/10/15 19:36:20
Done.
| |
445 if (filter) | 444 if (filter) |
446 current_paint_.setImageFilter(filter.get()); | 445 current_paint_.setImageFilter(filter.get()); |
447 } | 446 } |
448 | 447 |
449 if (quad->mask_resource_id) { | 448 if (quad->mask_resource_id) { |
450 ResourceProvider::ScopedReadLockSoftware mask_lock(resource_provider_, | 449 ResourceProvider::ScopedReadLockSoftware mask_lock(resource_provider_, |
451 quad->mask_resource_id); | 450 quad->mask_resource_id); |
452 | 451 |
453 const SkBitmap* mask = mask_lock.sk_bitmap(); | 452 const SkBitmap* mask = mask_lock.sk_bitmap(); |
454 | 453 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
554 EnsureBackbuffer(); | 553 EnsureBackbuffer(); |
555 else | 554 else |
556 DiscardBackbuffer(); | 555 DiscardBackbuffer(); |
557 } | 556 } |
558 | 557 |
559 void SoftwareRenderer::SetDiscardBackBufferWhenNotVisible(bool discard) { | 558 void SoftwareRenderer::SetDiscardBackBufferWhenNotVisible(bool discard) { |
560 // The software renderer always discards the backbuffer when not visible. | 559 // The software renderer always discards the backbuffer when not visible. |
561 } | 560 } |
562 | 561 |
563 } // namespace cc | 562 } // namespace cc |
OLD | NEW |