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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: cc/playback/decoded_draw_image.h
diff --git a/cc/playback/decoded_draw_image.h b/cc/playback/decoded_draw_image.h
new file mode 100644
index 0000000000000000000000000000000000000000..299c4b40c74a48da62f66dc2e0ed42249f5bd627
--- /dev/null
+++ b/cc/playback/decoded_draw_image.h
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_PLAYBACK_DECODED_DRAW_IMAGE_H_
+#define CC_PLAYBACK_DECODED_DRAW_IMAGE_H_
+
+#include <cfloat>
+
+#include "third_party/skia/include/core/SkFilterQuality.h"
+#include "third_party/skia/include/core/SkImage.h"
+#include "third_party/skia/include/core/SkSize.h"
+
+namespace cc {
+
+class DecodedDrawImage {
+ public:
+ DecodedDrawImage(const SkImage* image,
+ const SkSize& scale_adjustment,
+ SkFilterQuality filter_quality)
+ : image_(image),
+ scale_adjustment_(scale_adjustment),
+ filter_quality_(filter_quality),
+ at_raster_decode_(false) {}
+
+ const SkImage* image() const { return image_; }
+ const SkSize& scale_adjustment() const { return scale_adjustment_; }
+ SkFilterQuality filter_quality() const { return filter_quality_; }
+ bool is_scale_adjustment_identity() const {
+ return std::abs(scale_adjustment_.width() - 1.f) < FLT_EPSILON &&
+ std::abs(scale_adjustment_.height() - 1.f) < FLT_EPSILON;
+ }
+
+ void set_at_raster_decode(bool at_raster_decode) {
+ at_raster_decode_ = at_raster_decode;
+ }
+ bool is_at_raster_decode() const { return at_raster_decode_; }
+
+ private:
+ const SkImage* image_;
+ SkSize scale_adjustment_;
ericrk 2015/12/04 00:50:46 const? same below.
+ SkFilterQuality filter_quality_;
+ bool at_raster_decode_;
+};
+
+} // namespace cc
+
+#endif // CC_PLAYBACK_DECODED_DRAW_IMAGE_H_

Powered by Google App Engine
This is Rietveld 408576698