DUMPTRACE("SourceHeight: %d", source_crop_height_);
DUMPTRACE("DstWidth: %d", display_frame_width_);
DUMPTRACE("DstHeight: %d", display_frame_height_);
+ DUMPTRACE("Source crop %s", StringifyRect(source_crop_).c_str());
+ DUMPTRACE("Display frame %s", StringifyRect(display_frame_).c_str());
+ DUMPTRACE("Surface Damage %s", StringifyRect(surface_damage_).c_str());
DUMPTRACE("AquireFence: %d", imported_buffer_->acquire_fence_);
imported_buffer_->buffer_->Dump();
return 1;
}
+std::string StringifyRect(HwcRect<int> rect) {
+ std::stringstream ss;
+ ss << "{(" << rect.left << "," << rect.top << ") "
+ << "(" << rect.right << "," << rect.bottom << ")}";
+
+ return ss.str();
+}
+
+std::string StringifyRegion(HwcRegion region) {
+ std::stringstream ss;
+ std::string separator = "";
+
+ ss << "[";
+ for (auto& rect : region) {
+ ss << separator << StringifyRect(rect);
+ separator = ", ";
+ }
+ ss << "]";
+
+ return ss.str();
+}
+
} // namespace hwcomposer
#define COMMON_UTILS_HWCUTILS_H_
#include <hwcdefs.h>
+#include <sstream>
namespace hwcomposer {
}
}
+/**
+ * Pretty-print HwcRect for debugging.
+ */
+std::string StringifyRect(HwcRect<int> rect);
+
+/**
+ * Pretty-print HwcRegion for debugging.
+ */
+std::string StringifyRegion(HwcRegion region);
+
} // namespace hwcomposer
#endif // COMMON_UTILS_HWCUTILS_H_