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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h

Issue 2212163002: Add some plumbing for the color management of canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 int getFontBaseline(const FontMetrics&) const; 197 int getFontBaseline(const FontMetrics&) const;
198 198
199 void drawFocusIfNeededInternal(const Path&, Element*); 199 void drawFocusIfNeededInternal(const Path&, Element*);
200 bool focusRingCallIsValid(const Path&, Element*); 200 bool focusRingCallIsValid(const Path&, Element*);
201 void drawFocusRing(const Path&); 201 void drawFocusRing(const Path&);
202 void updateElementAccessibility(const Path&, Element*); 202 void updateElementAccessibility(const Path&, Element*);
203 203
204 CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::Context2d; } 204 CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::Context2d; }
205 bool is2d() const override { return true; } 205 bool is2d() const override { return true; }
206 bool isAccelerated() const override; 206 bool isAccelerated() const override;
207 bool hasAlpha() const override { return m_hasAlpha; } 207 bool hasAlpha() const override { return creationAttributes().alpha(); }
208 void setIsHidden(bool) override; 208 void setIsHidden(bool) override;
209 void stop() final; 209 void stop() final;
210 DECLARE_VIRTUAL_TRACE(); 210 DECLARE_VIRTUAL_TRACE();
211 211
212 virtual bool isTransformInvertible() const; 212 virtual bool isTransformInvertible() const;
213 213
214 WebLayer* platformLayer() const override; 214 WebLayer* platformLayer() const override;
215 215
216 Member<HitRegionManager> m_hitRegionManager; 216 Member<HitRegionManager> m_hitRegionManager;
217 bool m_hasAlpha;
218 LostContextMode m_contextLostMode; 217 LostContextMode m_contextLostMode;
219 bool m_contextRestorable; 218 bool m_contextRestorable;
220 unsigned m_tryRestoreContextAttemptCount; 219 unsigned m_tryRestoreContextAttemptCount;
221 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; 220 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer;
222 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; 221 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer;
223 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; 222 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer;
224 223
225 HashMap<String, Font> m_fontsResolvedUsingCurrentStyle; 224 HashMap<String, Font> m_fontsResolvedUsingCurrentStyle;
226 bool m_pruneLocalFontCacheScheduled; 225 bool m_pruneLocalFontCacheScheduled;
227 ListHashSet<String> m_fontLRUList; 226 ListHashSet<String> m_fontLRUList;
228 227
229 bool isPaintable() const final 228 bool isPaintable() const final
230 { 229 {
231 NOTREACHED(); 230 NOTREACHED();
232 return false; 231 return false;
233 } 232 }
234 }; 233 };
235 234
236 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, 235 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context,
237 context->is2d() && context->canvas(), context.is2d() && context.canvas()); 236 context->is2d() && context->canvas(), context.is2d() && context.canvas());
238 237
239 } // namespace blink 238 } // namespace blink
240 239
241 #endif // CanvasRenderingContext2D_h 240 #endif // CanvasRenderingContext2D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698