Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4088)

Unified Diff: cc/test/layer_test_common.h

Issue 2803853007: Ignore rounding error between clip_layer_length_ and scroll_layer_length_ (Closed)
Patch Set: expose IsFloatNearlyTheSame & add comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/test/layer_test_common.h
diff --git a/cc/test/layer_test_common.h b/cc/test/layer_test_common.h
index 3a535651bf92229cb9c5980b989414d30e2293eb..e1cf60f2da4dafe7abb50bfcfb1bcdff1a1de2e4 100644
--- a/cc/test/layer_test_common.h
+++ b/cc/test/layer_test_common.h
@@ -142,6 +142,25 @@ class LayerTestCommon {
return ptr;
}
+ template <typename T,
+ typename A,
+ typename B,
+ typename C,
+ typename D,
+ typename E>
+ T* AddChild(LayerImpl* parent,
+ const A& a,
+ const B& b,
+ const C& c,
+ const D& d,
+ const E& e) {
+ std::unique_ptr<T> layer = T::Create(host_->host_impl()->active_tree(),
+ layer_impl_id_++, a, b, c, d, e);
+ T* ptr = layer.get();
+ parent->test_properties()->AddChild(std::move(layer));
+ return ptr;
+ }
+
void CalcDrawProps(const gfx::Size& viewport_size);
void AppendQuadsWithOcclusion(LayerImpl* layer_impl,
const gfx::Rect& occluded);

Powered by Google App Engine
This is Rietveld 408576698