Task: Implement the Copy and CopyAll Methods in the RenderPass Class
Functionality to be implemented:
You need to implement the Copy and CopyAll methods within the RenderPass class, which are responsible for creating a copy of a RenderPass object and its associated data structures.
Specific Requirements:
Copy(RenderPass::Id new_id) method:
Create a new RenderPass object with the provided new_id.
The following properties of the new object should be identical to the original (except id):
output_rect
transform_to_root_target
damage_rect
has_transparent_background
The quad_list in the copied object should be empty.
The copy_requests list should not get copied (the copied object should have an empty copy_requests list).
Take a list of RenderPass objects (source_list) and populate the destination_list with copies of each RenderPass in source_list.
Each copied RenderPass should maintain the same characteristics as described in the first point, except for the identifier.
Quads using SharedQuadStates that are culled (i.e., not present in the output_rect) should also be properly handled.
Memory management:
Ensure correct usage of smart pointers (e.g., scoped_ptr) to manage the lifetime of dynamically allocated objects.
Once you have implemented the required methods, the provided tests must pass successfully. Place the solution in the /app/ directory under the appropriate files for RenderPass class implementation.