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

Side by Side Diff: sky/engine/bindings/core/v8/custom/V8HTMLCanvasElementCustom.cpp

Issue 731863003: Remove CSSCompositing (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: preland Created 6 years, 1 month 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
« no previous file with comments | « no previous file | sky/engine/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 3 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 v8::Handle<v8::String> preserveDrawingBuffer = v8AtomicString(isolat e, "preserveDrawingBuffer"); 76 v8::Handle<v8::String> preserveDrawingBuffer = v8AtomicString(isolat e, "preserveDrawingBuffer");
77 if (jsAttributes->Has(preserveDrawingBuffer) && !isUndefinedOrNull(j sAttributes->Get(preserveDrawingBuffer))) 77 if (jsAttributes->Has(preserveDrawingBuffer) && !isUndefinedOrNull(j sAttributes->Get(preserveDrawingBuffer)))
78 webGLAttributes->setPreserveDrawingBuffer(jsAttributes->Get(pres erveDrawingBuffer)->BooleanValue()); 78 webGLAttributes->setPreserveDrawingBuffer(jsAttributes->Get(pres erveDrawingBuffer)->BooleanValue());
79 v8::Handle<v8::String> failIfMajorPerformanceCaveat = v8AtomicString (isolate, "failIfMajorPerformanceCaveat"); 79 v8::Handle<v8::String> failIfMajorPerformanceCaveat = v8AtomicString (isolate, "failIfMajorPerformanceCaveat");
80 if (jsAttributes->Has(failIfMajorPerformanceCaveat) && !isUndefinedO rNull(jsAttributes->Get(failIfMajorPerformanceCaveat))) 80 if (jsAttributes->Has(failIfMajorPerformanceCaveat) && !isUndefinedO rNull(jsAttributes->Get(failIfMajorPerformanceCaveat)))
81 webGLAttributes->setFailIfMajorPerformanceCaveat(jsAttributes->G et(failIfMajorPerformanceCaveat)->BooleanValue()); 81 webGLAttributes->setFailIfMajorPerformanceCaveat(jsAttributes->G et(failIfMajorPerformanceCaveat)->BooleanValue());
82 } 82 }
83 attributes = webGLAttributes; 83 attributes = webGLAttributes;
84 } else { 84 } else {
85 RefPtr<Canvas2DContextAttributes> canvas2DAttributes = Canvas2DContextAt tributes::create(); 85 RefPtr<Canvas2DContextAttributes> canvas2DAttributes = Canvas2DContextAt tributes::create();
86 if (info.Length() > 1 && info[1]->IsObject()) {
87 v8::Handle<v8::Object> jsAttributes = info[1]->ToObject();
88 v8::Handle<v8::String> alpha = v8AtomicString(isolate, "alpha");
89 if (jsAttributes->Has(alpha) && !isUndefinedOrNull(jsAttributes->Get (alpha)))
90 canvas2DAttributes->setAlpha(jsAttributes->Get(alpha)->BooleanVa lue());
91 }
92 attributes = canvas2DAttributes; 86 attributes = canvas2DAttributes;
93 } 87 }
94 CanvasRenderingContext* result = impl->getContext(contextId, attributes.get( )); 88 CanvasRenderingContext* result = impl->getContext(contextId, attributes.get( ));
95 if (!result) { 89 if (!result) {
96 v8SetReturnValueNull(info); 90 v8SetReturnValueNull(info);
97 return; 91 return;
98 } 92 }
99 if (result->is2d()) { 93 if (result->is2d()) {
100 v8::Handle<v8::Value> v8Result = toV8(toCanvasRenderingContext2D(result) , info.Holder(), info.GetIsolate()); 94 v8::Handle<v8::Value> v8Result = toV8(toCanvasRenderingContext2D(result) , info.Holder(), info.GetIsolate());
101 v8SetReturnValue(info, v8Result); 95 v8SetReturnValue(info, v8Result);
(...skipping 21 matching lines...) Expand all
123 quality = info[1]->NumberValue(); 117 quality = info[1]->NumberValue();
124 qualityPtr = &quality; 118 qualityPtr = &quality;
125 } 119 }
126 120
127 String result = canvas->toDataURL(type, qualityPtr, exceptionState); 121 String result = canvas->toDataURL(type, qualityPtr, exceptionState);
128 exceptionState.throwIfNeeded(); 122 exceptionState.throwIfNeeded();
129 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate()); 123 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate());
130 } 124 }
131 125
132 } // namespace blink 126 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698