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

Unified Diff: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h

Issue 2077413005: Add "alpha" option to PaintWorklet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set alpha to be true by default Created 4 years, 5 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: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
index 03b3fa65a15a3af1ace2a25a74309149e2ab2bb5..9ce602fc19701322f307c93d6417b0422508df0d 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
+++ b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
@@ -23,9 +23,9 @@ class MODULES_EXPORT PaintRenderingContext2D : public BaseRenderingContext2D, pu
USING_GARBAGE_COLLECTED_MIXIN(PaintRenderingContext2D);
WTF_MAKE_NONCOPYABLE(PaintRenderingContext2D);
public:
- static PaintRenderingContext2D* create(std::unique_ptr<ImageBuffer> imageBuffer)
+ static PaintRenderingContext2D* create(std::unique_ptr<ImageBuffer> imageBuffer, bool hasAlpha)
{
- return new PaintRenderingContext2D(std::move(imageBuffer));
+ return new PaintRenderingContext2D(std::move(imageBuffer), hasAlpha);
}
// BaseRenderingContext2D
@@ -62,15 +62,16 @@ public:
void validateStateStack() final;
- bool hasAlpha() const final { return true; }
+ bool hasAlpha() const final { return m_hasAlpha; }
// PaintRenderingContext2D cannot lose it's context.
bool isContextLost() const final { return false; }
private:
- explicit PaintRenderingContext2D(std::unique_ptr<ImageBuffer>);
+ PaintRenderingContext2D(std::unique_ptr<ImageBuffer>, bool hasAlpha);
std::unique_ptr<ImageBuffer> m_imageBuffer;
+ bool m_hasAlpha;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698