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

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: 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
Index: Source/platform/graphics/GraphicsContext.h
diff --git a/Source/platform/graphics/GraphicsContext.h b/Source/platform/graphics/GraphicsContext.h
index e1ea64f874a750e30615d7840d379160a040e096..c0be6569a39d6882b7de8365539a1e4d9203676e 100644
--- a/Source/platform/graphics/GraphicsContext.h
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -109,9 +109,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(); }
@@ -336,7 +333,10 @@ public:
};
void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
+ // This behaves the same as save(), but in addition it allocates an offscreen buffer.
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();
@@ -447,6 +447,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);

Powered by Google App Engine
This is Rietveld 408576698