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

Unified Diff: cc/paint/paint_flags.cc

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: Rebase, move slow path counting Created 3 years, 9 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/paint/paint_flags.cc
diff --git a/cc/paint/paint_flags.cc b/cc/paint/paint_flags.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e16a8bb8073b501d5538513b986713c3de7acf9e
--- /dev/null
+++ b/cc/paint/paint_flags.cc
@@ -0,0 +1,42 @@
+// Copyright 2017 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 "cc/paint/paint_flags.h"
+
+namespace cc {
+
+bool PaintFlags::IsSimpleOpacity() const {
vmpstr 2017/03/28 18:27:14 It might be worth adding a comment somewhere in Pa
enne (OOO) 2017/03/28 19:28:05 This function is *on* PaintFlags. It seems like i
+ uint32_t color = getColor();
+ if (SK_ColorTRANSPARENT != SkColorSetA(color, SK_AlphaTRANSPARENT))
+ return false;
+ if (!isSrcOver())
+ return false;
+ if (getLooper())
+ return false;
+ if (getPathEffect())
+ return false;
+ if (getShader())
+ return false;
+ if (getMaskFilter())
+ return false;
+ if (getColorFilter())
+ return false;
+ if (getImageFilter())
+ return false;
+ return true;
+}
+
+bool PaintFlags::SupportsFoldingAlpha() const {
+ if (!isSrcOver())
+ return false;
+ if (getColorFilter())
+ return false;
+ if (getImageFilter())
+ return false;
+ if (getLooper())
+ return false;
+ return true;
+}
+
+} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698