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

Side by Side Diff: cc/playback/decoded_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: update Created 5 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_PLAYBACK_DECODED_DRAW_IMAGE_H_
6 #define CC_PLAYBACK_DECODED_DRAW_IMAGE_H_
7
8 #include <cfloat>
9
10 #include "third_party/skia/include/core/SkFilterQuality.h"
11 #include "third_party/skia/include/core/SkImage.h"
12 #include "third_party/skia/include/core/SkSize.h"
13
14 namespace cc {
15
16 class DecodedDrawImage {
17 public:
18 DecodedDrawImage(const SkImage* image,
19 const SkSize& scale_adjustment,
20 SkFilterQuality filter_quality)
21 : image_(image),
22 scale_adjustment_(scale_adjustment),
23 filter_quality_(filter_quality),
24 at_raster_decode_(false) {}
25
26 const SkImage* image() const { return image_; }
27 const SkSize& scale_adjustment() const { return scale_adjustment_; }
28 SkFilterQuality filter_quality() const { return filter_quality_; }
29 bool is_scale_adjustment_identity() const {
30 return std::abs(scale_adjustment_.width() - 1.f) < FLT_EPSILON &&
31 std::abs(scale_adjustment_.height() - 1.f) < FLT_EPSILON;
32 }
33
34 void set_at_raster_decode(bool at_raster_decode) {
35 at_raster_decode_ = at_raster_decode;
36 }
37 bool is_at_raster_decode() const { return at_raster_decode_; }
38
39 private:
40 const SkImage* image_;
41 SkSize scale_adjustment_;
ericrk 2015/12/04 00:50:46 const? same below.
42 SkFilterQuality filter_quality_;
43 bool at_raster_decode_;
44 };
45
46 } // namespace cc
47
48 #endif // CC_PLAYBACK_DECODED_DRAW_IMAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698