Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: cc/playback/image_hijack_canvas.cc

Issue 2688503004: cc: Ensure to respect decoded filter quality adjustment in bg images. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/borders/border-image-side-reduction-expected.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/playback/image_hijack_canvas.h" 5 #include "cc/playback/image_hijack_canvas.h"
6 6
7 #include "base/optional.h" 7 #include "base/optional.h"
8 #include "cc/playback/discardable_image_map.h" 8 #include "cc/playback/discardable_image_map.h"
9 #include "cc/tiles/image_decode_cache.h" 9 #include "cc/tiles/image_decode_cache.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return base::Optional<ScopedImagePaint>(); 98 return base::Optional<ScopedImagePaint>();
99 99
100 bool need_scale = !decoded_image.is_scale_adjustment_identity(); 100 bool need_scale = !decoded_image.is_scale_adjustment_identity();
101 if (need_scale) { 101 if (need_scale) {
102 matrix.preScale(1.f / decoded_image.scale_adjustment().width(), 102 matrix.preScale(1.f / decoded_image.scale_adjustment().width(),
103 1.f / decoded_image.scale_adjustment().height()); 103 1.f / decoded_image.scale_adjustment().height());
104 } 104 }
105 SkPaint scratch_paint = paint; 105 SkPaint scratch_paint = paint;
106 scratch_paint.setShader( 106 scratch_paint.setShader(
107 decoded_image.image()->makeShader(xy[0], xy[1], &matrix)); 107 decoded_image.image()->makeShader(xy[0], xy[1], &matrix));
108 scratch_paint.setFilterQuality(decoded_image.filter_quality());
108 return ScopedImagePaint(std::move(scoped_lock), std::move(scratch_paint)); 109 return ScopedImagePaint(std::move(scoped_lock), std::move(scratch_paint));
109 } 110 }
110 111
111 const SkPaint& paint() { return paint_; } 112 const SkPaint& paint() { return paint_; }
112 113
113 private: 114 private:
114 ScopedImagePaint(ScopedDecodedImageLock lock, SkPaint paint) 115 ScopedImagePaint(ScopedDecodedImageLock lock, SkPaint paint)
115 : lock_(std::move(lock)), paint_(std::move(paint)) {} 116 : lock_(std::move(lock)), paint_(std::move(paint)) {}
116 117
117 ScopedDecodedImageLock lock_; 118 ScopedDecodedImageLock lock_;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 265
265 void ImageHijackCanvas::onDrawImageNine(const SkImage* image, 266 void ImageHijackCanvas::onDrawImageNine(const SkImage* image,
266 const SkIRect& center, 267 const SkIRect& center,
267 const SkRect& dst, 268 const SkRect& dst,
268 const SkPaint* paint) { 269 const SkPaint* paint) {
269 // No cc embedder issues image nine calls. 270 // No cc embedder issues image nine calls.
270 NOTREACHED(); 271 NOTREACHED();
271 } 272 }
272 273
273 } // namespace cc 274 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/borders/border-image-side-reduction-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698