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

Unified Diff: Source/core/paint/PaintPhase.h

Issue 1236183003: Add 'printing' flag to PaintInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: PrintAdaption -> Printing; printing -> isPrinting; Comment fixups. Created 5 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
« no previous file with comments | « Source/core/paint/PaintInfo.h ('k') | Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/PaintPhase.h
diff --git a/Source/core/paint/PaintPhase.h b/Source/core/paint/PaintPhase.h
index e66db71fc4fa9b8a0be2f42c9bc3b1688272485c..657d0ba1cd68378eea4e7d923ac967e39f42a739 100644
--- a/Source/core/paint/PaintPhase.h
+++ b/Source/core/paint/PaintPhase.h
@@ -57,8 +57,9 @@ enum PaintPhase {
enum PaintBehaviorFlags {
PaintBehaviorNormal = 0,
- // TODO(jchaffraix): Remove those 2 once we have migrated to GlobalPaintFlags.
+ // TODO(jchaffraix): Remove those 3 once we have migrated to GlobalPaintFlags.
PaintBehaviorSelectionOnly = 1 << 0,
+ PaintBehaviorPrinting = 1 << 1,
PaintBehaviorFlattenCompositingLayers = 1 << 2,
PaintBehaviorRenderingClipPathAsMask = 1 << 3,
PaintBehaviorSkipRootBackground = 1 << 4,
@@ -80,7 +81,11 @@ enum GlobalPaintFlag {
// Used when painting a drag-image or printing in order to
// ignore the hardware layers and paint the whole tree
// into the topmost layer.
- GlobalPaintFlattenCompositingLayers = 1 << 1
+ GlobalPaintFlattenCompositingLayers = 1 << 1,
+ // Used when printing in order to adapt the output to the medium, for
+ // instance by not painting shadows and selections on text, and add
+ // URL metadata for links.
+ GlobalPaintPrinting = 1 << 2
};
typedef unsigned GlobalPaintFlags;
@@ -94,6 +99,8 @@ inline PaintBehavior toPaintBehavior(GlobalPaintFlags flags)
behavior |= PaintBehaviorSelectionOnly;
if (flags & GlobalPaintFlattenCompositingLayers)
behavior |= PaintBehaviorFlattenCompositingLayers;
+ if (flags & GlobalPaintPrinting)
+ behavior |= PaintBehaviorPrinting;
return behavior;
}
inline GlobalPaintFlags toGlobalPaintFlags(PaintBehavior behavior)
@@ -103,6 +110,8 @@ inline GlobalPaintFlags toGlobalPaintFlags(PaintBehavior behavior)
flags |= GlobalPaintSelectionOnly;
if (behavior & PaintBehaviorFlattenCompositingLayers)
flags |= GlobalPaintFlattenCompositingLayers;
+ if (behavior & PaintBehaviorPrinting)
+ flags |= GlobalPaintPrinting;
return flags;
}
« no previous file with comments | « Source/core/paint/PaintInfo.h ('k') | Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698