Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 5 #include "android_webview/browser/parent_compositor_draw_constraints.h" | |
| 6 | |
| 7 namespace android_webview { | |
| 8 | |
| 9 ParentCompositorDrawConstraints::ParentCompositorDrawConstraints() | |
| 10 : is_layer(false) { | |
| 11 } | |
| 12 | |
| 13 ParentCompositorDrawConstraints::ParentCompositorDrawConstraints( | |
| 14 bool is_layer, | |
| 15 const gfx::Transform& transform, | |
| 16 const gfx::Rect& surface_rect) | |
| 17 : is_layer(is_layer), transform(transform), surface_rect(surface_rect) { | |
| 18 } | |
| 19 | |
| 20 bool ParentCompositorDrawConstraints::Equals( | |
| 21 const ParentCompositorDrawConstraints& other) const { | |
| 22 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
| |
| 23 return false; | |
| 24 // Don't care about the surface size when neither is on a layer. | |
| 25 if (!is_layer) | |
| 26 return transform == other.transform; | |
| 27 else | |
| 28 return surface_rect == other.surface_rect && transform == other.transform; | |
| 29 } | |
| 30 | |
| 31 } // namespace webview | |
| OLD | NEW |