| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/raster/image_hijack_canvas.h" | 5 #include "cc/raster/image_hijack_canvas.h" |
| 6 | 6 |
| 7 #include "base/optional.h" | 7 #include "base/optional.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "cc/paint/discardable_image_map.h" | 9 #include "cc/paint/discardable_image_map.h" |
| 10 #include "cc/tiles/image_decode_cache.h" | 10 #include "cc/tiles/image_decode_cache.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class ScopedDecodedImageLock { | 22 class ScopedDecodedImageLock { |
| 23 public: | 23 public: |
| 24 ScopedDecodedImageLock(ImageDecodeCache* image_decode_cache, | 24 ScopedDecodedImageLock(ImageDecodeCache* image_decode_cache, |
| 25 sk_sp<const SkImage> image, | 25 sk_sp<const SkImage> image, |
| 26 const SkRect& src_rect, | 26 const SkRect& src_rect, |
| 27 const SkMatrix& matrix, | 27 const SkMatrix& matrix, |
| 28 const SkPaint* paint, | 28 const SkPaint* paint, |
| 29 const gfx::ColorSpace& target_color_space) | 29 const gfx::ColorSpace& target_color_space) |
| 30 : image_decode_cache_(image_decode_cache), | 30 : image_decode_cache_(image_decode_cache), |
| 31 draw_image_(std::move(image), | 31 draw_image_(PaintImage(std::move(image)), |
| 32 RoundOutRect(src_rect), | 32 RoundOutRect(src_rect), |
| 33 paint ? paint->getFilterQuality() : kNone_SkFilterQuality, | 33 paint ? paint->getFilterQuality() : kNone_SkFilterQuality, |
| 34 matrix, | 34 matrix, |
| 35 target_color_space), | 35 target_color_space), |
| 36 decoded_draw_image_( | 36 decoded_draw_image_( |
| 37 image_decode_cache_->GetDecodedImageForDraw(draw_image_)) { | 37 image_decode_cache_->GetDecodedImageForDraw(draw_image_)) { |
| 38 DCHECK(draw_image_.image()->isLazyGenerated()); | 38 DCHECK(draw_image_.image()->isLazyGenerated()); |
| 39 if (paint) { | 39 if (paint) { |
| 40 decoded_paint_ = *paint; | 40 decoded_paint_ = *paint; |
| 41 decoded_paint_->setFilterQuality(decoded_draw_image_.filter_quality()); | 41 decoded_paint_->setFilterQuality(decoded_draw_image_.filter_quality()); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 SkRect tmp = rect; | 368 SkRect tmp = rect; |
| 369 if (paint) | 369 if (paint) |
| 370 paint->computeFastBounds(tmp, &tmp); | 370 paint->computeFastBounds(tmp, &tmp); |
| 371 return quickReject(tmp); | 371 return quickReject(tmp); |
| 372 } | 372 } |
| 373 | 373 |
| 374 return false; | 374 return false; |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace cc | 377 } // namespace cc |
| OLD | NEW |