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

Side by Side Diff: Source/core/html/canvas/WebGLContextAttributes.cpp

Issue 365653002: Oilpan: move 2D Canvas and WebGL objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Smaller adjustments Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * * Redistributions of source code must retain the above copyright 7 * * 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 * * Redistributions in binary form must reproduce the above 9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following disclaimer 10 * copyright notice, this list of conditions and the following disclaimer
(...skipping 14 matching lines...) Expand all
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 28
29 #include "core/html/canvas/WebGLContextAttributes.h" 29 #include "core/html/canvas/WebGLContextAttributes.h"
30 30
31 #include "core/frame/Settings.h" 31 #include "core/frame/Settings.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 PassRefPtr<WebGLContextAttributes> WebGLContextAttributes::create() 35 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(WebGLContextAttributes);
36
37 PassRefPtrWillBeRawPtr<WebGLContextAttributes> WebGLContextAttributes::create()
36 { 38 {
37 return adoptRef(new WebGLContextAttributes()); 39 return adoptRefWillBeNoop(new WebGLContextAttributes());
38 } 40 }
39 41
40 WebGLContextAttributes::WebGLContextAttributes() 42 WebGLContextAttributes::WebGLContextAttributes()
41 : CanvasContextAttributes() 43 : CanvasContextAttributes()
42 , m_alpha(true) 44 , m_alpha(true)
43 , m_depth(true) 45 , m_depth(true)
44 , m_stencil(false) 46 , m_stencil(false)
45 , m_antialias(true) 47 , m_antialias(true)
46 , m_premultipliedAlpha(true) 48 , m_premultipliedAlpha(true)
47 , m_preserveDrawingBuffer(false) 49 , m_preserveDrawingBuffer(false)
48 , m_failIfMajorPerformanceCaveat(false) 50 , m_failIfMajorPerformanceCaveat(false)
49 { 51 {
50 ScriptWrappable::init(this); 52 ScriptWrappable::init(this);
51 } 53 }
52 54
53 WebGLContextAttributes::WebGLContextAttributes(const WebGLContextAttributes& att rs) 55 WebGLContextAttributes::WebGLContextAttributes(const WebGLContextAttributes& att rs)
54 : CanvasContextAttributes() 56 : CanvasContextAttributes()
55 , m_alpha(attrs.m_alpha) 57 , m_alpha(attrs.m_alpha)
56 , m_depth(attrs.m_depth) 58 , m_depth(attrs.m_depth)
57 , m_stencil(attrs.m_stencil) 59 , m_stencil(attrs.m_stencil)
58 , m_antialias(attrs.m_antialias) 60 , m_antialias(attrs.m_antialias)
59 , m_premultipliedAlpha(attrs.m_premultipliedAlpha) 61 , m_premultipliedAlpha(attrs.m_premultipliedAlpha)
60 , m_preserveDrawingBuffer(attrs.m_preserveDrawingBuffer) 62 , m_preserveDrawingBuffer(attrs.m_preserveDrawingBuffer)
61 , m_failIfMajorPerformanceCaveat(attrs.m_failIfMajorPerformanceCaveat) 63 , m_failIfMajorPerformanceCaveat(attrs.m_failIfMajorPerformanceCaveat)
62 { 64 {
63 ScriptWrappable::init(this); 65 ScriptWrappable::init(this);
64 } 66 }
65 67
66 WebGLContextAttributes::~WebGLContextAttributes() 68 PassRefPtrWillBeRawPtr<WebGLContextAttributes> WebGLContextAttributes::clone() c onst
67 { 69 {
68 } 70 return adoptRefWillBeNoop(new WebGLContextAttributes(*this));
69
70 PassRefPtr<WebGLContextAttributes> WebGLContextAttributes::clone() const
71 {
72 return adoptRef(new WebGLContextAttributes(*this));
73 } 71 }
74 72
75 bool WebGLContextAttributes::alpha() const 73 bool WebGLContextAttributes::alpha() const
76 { 74 {
77 return m_alpha; 75 return m_alpha;
78 } 76 }
79 77
80 void WebGLContextAttributes::setAlpha(bool alpha) 78 void WebGLContextAttributes::setAlpha(bool alpha)
81 { 79 {
82 m_alpha = alpha; 80 m_alpha = alpha;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 162
165 attrs.topDocumentURL = topDocumentURL; 163 attrs.topDocumentURL = topDocumentURL;
166 164
167 attrs.webGL = true; 165 attrs.webGL = true;
168 attrs.webGLVersion = webGLVersion; 166 attrs.webGLVersion = webGLVersion;
169 167
170 return attrs; 168 return attrs;
171 } 169 }
172 170
173 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698