Bug 1351440 - Part 1. Implement imgDrawingParams. draft
authorcku <cku@mozilla.com>
Tue, 09 May 2017 13:41:18 +0800
changeset 580415 c1a7eac91cb4439d74d9488ec0d58f80e9cd912b
parent 580382 2fa6931995b23f1f39752385b6689dc6b8d94c1b
child 580416 1f99eb8cf856996547cdb9509fdc3004a9c29f1b
child 580452 e70b5243b3cd61e8844f22bfdf2098202f90450c
push id59542
push userbmo:cku@mozilla.com
push dateThu, 18 May 2017 14:00:40 +0000
bugs1351440
milestone55.0a1
Bug 1351440 - Part 1. Implement imgDrawingParams. A struct used during painting to provide input flags to determine how imagelib draw calls should behave, plus an output DrawResult to return information about the result of any imagelib draw calls that may have occurred. MozReview-Commit-ID: 3jGEh5vEPF
image/DrawResult.h
--- a/image/DrawResult.h
+++ b/image/DrawResult.h
@@ -79,12 +79,28 @@ operator&(const DrawResult aLeft, const 
 
 inline DrawResult&
 operator&=(DrawResult& aLeft, const DrawResult aRight)
 {
   aLeft = aLeft & aRight;
   return aLeft;
 }
 
+/**
+ * A struct used during painting to provide input flags to determine how
+ * imagelib draw calls should behave and an output DrawResult to return
+ * information about the result of any imagelib draw calls that may have
+ * occurred.
+ */
+struct imgDrawingParams {
+  explicit imgDrawingParams(uint32_t aImageFlags = 0)
+    : imageFlags(aImageFlags), result(DrawResult::SUCCESS)
+  {}
+
+  const uint32_t imageFlags; // imgIContainer::FLAG_* image flags to pass to
+                             // image lib draw calls.
+  DrawResult result;         // To return results from image lib painting.
+};
+
 } // namespace image
 } // namespace mozilla
 
 #endif // mozilla_image_DrawResult_h