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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 2552893005: Add ColorBehavior to GraphicsLayer and GraphicsContext (Closed)
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "third_party/skia/include/pathops/SkPathOps.h" 49 #include "third_party/skia/include/pathops/SkPathOps.h"
50 #include "third_party/skia/include/utils/SkNullCanvas.h" 50 #include "third_party/skia/include/utils/SkNullCanvas.h"
51 #include "wtf/Assertions.h" 51 #include "wtf/Assertions.h"
52 #include "wtf/MathExtras.h" 52 #include "wtf/MathExtras.h"
53 #include <memory> 53 #include <memory>
54 54
55 namespace blink { 55 namespace blink {
56 56
57 GraphicsContext::GraphicsContext(PaintController& paintController, 57 GraphicsContext::GraphicsContext(PaintController& paintController,
58 DisabledMode disableContextOrPainting, 58 DisabledMode disableContextOrPainting,
59 SkMetaData* metaData) 59 SkMetaData* metaData,
60 ColorBehavior colorBehavior)
60 : m_canvas(nullptr), 61 : m_canvas(nullptr),
61 m_paintController(paintController), 62 m_paintController(paintController),
62 m_paintStateStack(), 63 m_paintStateStack(),
63 m_paintStateIndex(0), 64 m_paintStateIndex(0),
65 m_colorBehavior(colorBehavior),
64 #if DCHECK_IS_ON() 66 #if DCHECK_IS_ON()
65 m_layerCount(0), 67 m_layerCount(0),
66 m_disableDestructionChecks(false), 68 m_disableDestructionChecks(false),
67 m_inDrawingRecorder(false), 69 m_inDrawingRecorder(false),
68 #endif 70 #endif
69 m_disabledState(disableContextOrPainting), 71 m_disabledState(disableContextOrPainting),
70 m_deviceScaleFactor(1.0f), 72 m_deviceScaleFactor(1.0f),
71 m_printing(false), 73 m_printing(false),
72 m_hasMetaData(!!metaData) { 74 m_hasMetaData(!!metaData) {
73 if (metaData) 75 if (metaData)
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 static const SkPMColor colors[] = { 1414 static const SkPMColor colors[] = {
1413 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1415 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1414 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1416 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1415 }; 1417 };
1416 1418
1417 return colors[index]; 1419 return colors[index];
1418 } 1420 }
1419 #endif 1421 #endif
1420 1422
1421 } // namespace blink 1423 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698