parent_compositor_draw_constraints.cc 1.0 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright 2014 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. #include "android_webview/browser/gfx/parent_compositor_draw_constraints.h"
  5. #include "android_webview/browser/gfx/child_frame.h"
  6. namespace android_webview {
  7. ParentCompositorDrawConstraints::ParentCompositorDrawConstraints() = default;
  8. ParentCompositorDrawConstraints::ParentCompositorDrawConstraints(
  9. const gfx::Size& viewport_size,
  10. const gfx::Transform& transform)
  11. : viewport_size(viewport_size), transform(transform) {}
  12. bool ParentCompositorDrawConstraints::NeedUpdate(
  13. const ChildFrame& frame) const {
  14. return viewport_size != frame.viewport_size_for_tile_priority ||
  15. transform != frame.transform_for_tile_priority;
  16. }
  17. bool ParentCompositorDrawConstraints::operator==(
  18. const ParentCompositorDrawConstraints& other) const {
  19. return viewport_size == other.viewport_size && transform == other.transform;
  20. }
  21. } // namespace android_webview