Chromium Code Reviews| Index: android_webview/browser/parent_compositor_draw_constraints.cc |
| diff --git a/android_webview/browser/parent_compositor_draw_constraints.cc b/android_webview/browser/parent_compositor_draw_constraints.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e528d762164672058eacd6074cacabe9f3d58068 |
| --- /dev/null |
| +++ b/android_webview/browser/parent_compositor_draw_constraints.cc |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "android_webview/browser/parent_compositor_draw_constraints.h" |
| + |
| +namespace android_webview { |
| + |
| +ParentCompositorDrawConstraints::ParentCompositorDrawConstraints() |
| + : is_layer(false) { |
| +} |
| + |
| +ParentCompositorDrawConstraints::ParentCompositorDrawConstraints( |
| + bool is_layer, |
| + const gfx::Transform& transform, |
| + const gfx::Rect& surface_rect) |
| + : is_layer(is_layer), transform(transform), surface_rect(surface_rect) { |
| +} |
| + |
| +bool ParentCompositorDrawConstraints::Equals( |
| + const ParentCompositorDrawConstraints& other) const { |
| + if (is_layer != other.is_layer) |
|
boliu
2014/07/30 00:16:37
You can do
if (is_layer != other.is_layer || tran
hush (inactive)
2014/07/30 00:34:29
Yeah this is cleaner.
The last line seems wrong th
|
| + return false; |
| + // Don't care about the surface size when neither is on a layer. |
| + if (!is_layer) |
| + return transform == other.transform; |
| + else |
| + return surface_rect == other.surface_rect && transform == other.transform; |
| +} |
| + |
| +} // namespace webview |