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

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

Issue 2042133002: Add display-resolution caching to GPU IDC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@drt
Patch Set: Add display-resolution caching to GPU IDC Created 4 years, 6 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
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 "cc/base/cc_export.h"
9 #include "third_party/skia/include/core/SkFilterQuality.h" 9 #include "third_party/skia/include/core/SkFilterQuality.h"
10 #include "third_party/skia/include/core/SkImage.h" 10 #include "third_party/skia/include/core/SkImage.h"
(...skipping 16 matching lines...) Expand all
27 ~DrawImage(); 27 ~DrawImage();
28 28
29 const sk_sp<const SkImage>& image() const { return image_; } 29 const sk_sp<const SkImage>& image() const { return image_; }
30 const SkSize& scale() const { return scale_; } 30 const SkSize& scale() const { return scale_; }
31 const SkIRect src_rect() const { return src_rect_; } 31 const SkIRect src_rect() const { return src_rect_; }
32 SkFilterQuality filter_quality() const { return filter_quality_; } 32 SkFilterQuality filter_quality() const { return filter_quality_; }
33 bool matrix_is_decomposable() const { return matrix_is_decomposable_; } 33 bool matrix_is_decomposable() const { return matrix_is_decomposable_; }
34 const SkMatrix& matrix() const { return matrix_; } 34 const SkMatrix& matrix() const { return matrix_; }
35 35
36 DrawImage ApplyScale(float scale) const { 36 DrawImage ApplyScale(float scale) const {
37 return ApplyScale(SkSize::Make(scale, scale));
38 }
39
40 DrawImage ApplyScale(const SkSize& scale) const {
37 SkMatrix scaled_matrix = matrix_; 41 SkMatrix scaled_matrix = matrix_;
38 scaled_matrix.postScale(scale, scale); 42 scaled_matrix.postScale(scale.width(), scale.height());
39 return DrawImage(image_, src_rect_, filter_quality_, scaled_matrix); 43 return DrawImage(image_, src_rect_, filter_quality_, scaled_matrix);
40 } 44 }
41 45
42 private: 46 private:
43 sk_sp<const SkImage> image_; 47 sk_sp<const SkImage> image_;
44 SkIRect src_rect_; 48 SkIRect src_rect_;
45 SkFilterQuality filter_quality_; 49 SkFilterQuality filter_quality_;
46 SkMatrix matrix_; 50 SkMatrix matrix_;
47 SkSize scale_; 51 SkSize scale_;
48 bool matrix_is_decomposable_; 52 bool matrix_is_decomposable_;
49 }; 53 };
50 54
51 } // namespace cc 55 } // namespace cc
52 56
53 #endif // CC_PLAYBACK_DRAW_IMAGE_H_ 57 #endif // CC_PLAYBACK_DRAW_IMAGE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/gpu_image_decode_controller.h » ('j') | cc/tiles/gpu_image_decode_controller.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698