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

Unified Diff: third_party/WebKit/Source/core/paint/PaintInfo.h

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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/core/paint/PaintInfo.h
diff --git a/third_party/WebKit/Source/core/paint/PaintInfo.h b/third_party/WebKit/Source/core/paint/PaintInfo.h
index 6e22688c0328c9e3464a93cfc13a664f660375d2..e5ad904e648ce2fc6dae86e2537d8f8d205d9d4b 100644
--- a/third_party/WebKit/Source/core/paint/PaintInfo.h
+++ b/third_party/WebKit/Source/core/paint/PaintInfo.h
@@ -51,13 +51,11 @@ class LayoutObject;
class PaintInvalidationState;
struct CORE_EXPORT PaintInfo {
- DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
- PaintInfo(GraphicsContext* newContext, const IntRect& cullRect, PaintPhase newPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags,
+ PaintInfo(GraphicsContext& newContext, const IntRect& cullRect, PaintPhase newPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags,
LayoutObject* newPaintingRoot = nullptr, const LayoutBoxModelObject* newPaintContainer = nullptr)
: context(newContext)
, phase(newPhase)
, paintingRoot(newPaintingRoot)
- , paintInvalidationState(nullptr)
, m_cullRect(cullRect)
, m_paintContainer(newPaintContainer)
, m_paintFlags(paintFlags)
@@ -65,6 +63,16 @@ struct CORE_EXPORT PaintInfo {
{
}
+ PaintInfo(GraphicsContext& newContext, const PaintInfo& copyOtherFieldsFrom)
+ : context(newContext)
+ , phase(copyOtherFieldsFrom.phase)
+ , paintingRoot(copyOtherFieldsFrom.paintingRoot)
+ , m_cullRect(copyOtherFieldsFrom.m_cullRect)
+ , m_paintContainer(copyOtherFieldsFrom.m_paintContainer)
+ , m_paintFlags(copyOtherFieldsFrom.m_paintFlags)
+ , m_globalPaintFlags(copyOtherFieldsFrom.m_globalPaintFlags)
+ { }
+
void updatePaintingRootForChildren(const LayoutObject*);
bool shouldPaintWithinRoot(const LayoutObject*) const;
@@ -89,11 +97,9 @@ struct CORE_EXPORT PaintInfo {
void updateCullRect(const AffineTransform& localToParentTransform);
// FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout layout/.
- GraphicsContext* context;
+ GraphicsContext& context;
PaintPhase phase;
LayoutObject* paintingRoot; // used to draw just one element and its visual kids
- // TODO(wangxianzhu): Populate it.
- PaintInvalidationState* paintInvalidationState;
private:
CullRect m_cullRect;

Powered by Google App Engine
This is Rietveld 408576698