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

Unified Diff: Source/platform/graphics/GraphicsContext.h

Issue 651243002: Clarify GraphicsContext::beginLayer()/endLayer() have unexpected behaviors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Just comment Created 6 years, 2 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
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceClipper.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.h
diff --git a/Source/platform/graphics/GraphicsContext.h b/Source/platform/graphics/GraphicsContext.h
index 42189353bdfe69e13ce2c54ddf4266a8c248cf2f..bc5afd094cbb0882b49bb2b7d44cb2536ddd489a 100644
--- a/Source/platform/graphics/GraphicsContext.h
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -98,9 +98,6 @@ public:
void disableDestructionChecks() { m_disableDestructionChecks = true; }
#endif
- void saveLayer(const SkRect* bounds, const SkPaint*);
- void restoreLayer();
-
bool hasStroke() const { return strokeStyle() != NoStroke && strokeThickness() > 0; }
float strokeThickness() const { return immutableState()->strokeData().thickness(); }
@@ -325,7 +322,10 @@ public:
};
void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
+ // beginLayer()/endLayer() behaves like save()/restore() for only CTM and clip states.
void beginTransparencyLayer(float opacity, const FloatRect* = 0);
+ // Apply CompositeOperator when the layer is composited on the backdrop (i.e. endLayer()).
+ // Don't change the current CompositeOperator state.
void beginLayer(float opacity, CompositeOperator, const FloatRect* = 0, ColorFilter = ColorFilterNone, ImageFilter* = 0);
void endLayer();
@@ -436,6 +436,9 @@ private:
static void draw2xMarker(SkBitmap*, int);
#endif
+ void saveLayer(const SkRect* bounds, const SkPaint*);
+ void restoreLayer();
+
// Helpers for drawing a focus ring (drawFocusRing)
float prepareFocusRingPaint(SkPaint&, const Color&, int width) const;
void drawFocusRingPath(const SkPath&, const Color&, int width);
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceClipper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698