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

Side by Side Diff: cc/playback/draw_image.h

Issue 1418573002: cc: Add image decode control in the compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 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 | « cc/playback/display_list_raster_source.cc ('k') | cc/playback/draw_image.cc » ('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 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 #ifndef CC_PLAYBACK_DRAW_IMAGE_H_ 5 #ifndef CC_PLAYBACK_DRAW_IMAGE_H_
6 #define CC_PLAYBACK_DRAW_IMAGE_H_ 6 #define CC_PLAYBACK_DRAW_IMAGE_H_
7 7
8 #include "cc/base/cc_export.h"
8 #include "third_party/skia/include/core/SkFilterQuality.h" 9 #include "third_party/skia/include/core/SkFilterQuality.h"
9 #include "third_party/skia/include/core/SkImage.h" 10 #include "third_party/skia/include/core/SkImage.h"
10 #include "third_party/skia/include/core/SkMatrix.h" 11 #include "third_party/skia/include/core/SkMatrix.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 class DrawImage { 15 // TODO(vmpstr): This should probably be DISALLOW_COPY_AND_ASSIGN and transport
16 // it around using a pointer, since it became kind of large. Profile.
17 class CC_EXPORT DrawImage {
15 public: 18 public:
16 DrawImage() : image_(nullptr), filter_quality_(kNone_SkFilterQuality) {} 19 DrawImage();
17 DrawImage(const SkImage* image, 20 DrawImage(const SkImage* image,
21 const SkIRect& src_rect,
18 const SkSize& scale, 22 const SkSize& scale,
19 SkFilterQuality filter_quality) 23 SkFilterQuality filter_quality,
20 : image_(image), scale_(scale), filter_quality_(filter_quality) {} 24 bool matrix_has_perspective,
25 bool matrix_is_decomposable);
26 DrawImage(const DrawImage& other);
21 27
22 const SkImage* image() const { return image_; } 28 const SkImage* image() const { return image_; }
23 const SkSize& scale() const { return scale_; } 29 const SkSize& scale() const { return scale_; }
30 const SkIRect src_rect() const { return src_rect_; }
24 SkFilterQuality filter_quality() const { return filter_quality_; } 31 SkFilterQuality filter_quality() const { return filter_quality_; }
32 bool matrix_has_perspective() const { return matrix_has_perspective_; }
33 bool matrix_is_decomposable() const { return matrix_is_decomposable_; }
25 34
26 DrawImage ApplyScale(float scale) const { 35 DrawImage ApplyScale(float scale) const {
27 return DrawImage( 36 return DrawImage(
28 image_, SkSize::Make(scale_.width() * scale, scale_.height() * scale), 37 image_, src_rect_,
29 filter_quality_); 38 SkSize::Make(scale_.width() * scale, scale_.height() * scale),
39 filter_quality_, matrix_has_perspective_, matrix_is_decomposable_);
30 } 40 }
31 41
32 private: 42 private:
33 const SkImage* image_; 43 const SkImage* image_;
44 SkIRect src_rect_;
34 SkSize scale_; 45 SkSize scale_;
35 SkFilterQuality filter_quality_; 46 SkFilterQuality filter_quality_;
47 bool matrix_has_perspective_;
48 bool matrix_is_decomposable_;
36 }; 49 };
37 50
38 } // namespace cc 51 } // namespace cc
39 52
40 #endif // CC_PLAYBACK_DRAW_IMAGE_H_ 53 #endif // CC_PLAYBACK_DRAW_IMAGE_H_
OLDNEW
« no previous file with comments | « cc/playback/display_list_raster_source.cc ('k') | cc/playback/draw_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698