clear_for_opaque_raster.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2020 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. #ifndef CC_PAINT_CLEAR_FOR_OPAQUE_RASTER_H_
  5. #define CC_PAINT_CLEAR_FOR_OPAQUE_RASTER_H_
  6. #include "cc/paint/paint_export.h"
  7. namespace gfx {
  8. class Rect;
  9. class Size;
  10. class Vector2dF;
  11. } // namespace gfx
  12. namespace cc {
  13. // Called when we are drawing opaque content with |translation| and |scale|.
  14. // Calculates |outer_rect| and |inner_rect| between which the drawn content
  15. // would not be opaque due to |translation| and/or |scale| and should be cleared
  16. // with an opaque color before drawing the original contents, to ensure all
  17. // texels are fully opaque. The output rects are in the device space.
  18. // Returns false if no clearing for opaque is needed.
  19. bool CC_PAINT_EXPORT
  20. CalculateClearForOpaqueRasterRects(const gfx::Vector2dF& translation,
  21. const gfx::Vector2dF& scale,
  22. const gfx::Size& content_size,
  23. const gfx::Rect& canvas_bitmap_rect,
  24. const gfx::Rect& canvas_playback_rect,
  25. gfx::Rect& outer_rect,
  26. gfx::Rect& inner_rect);
  27. } // namespace cc
  28. #endif // CC_PAINT_CLEAR_FOR_OPAQUE_RASTER_H_