| OLD | NEW | 
|    1 // Copyright 2015 The Chromium Authors. All rights reserved. |    1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
|    2 // Use of this source code is governed by a BSD-style license that can be |    2 // Use of this source code is governed by a BSD-style license that can be | 
|    3 // found in the LICENSE file. |    3 // found in the LICENSE file. | 
|    4  |    4  | 
|    5 #include "core/offscreencanvas/OffscreenCanvas.h" |    5 #include "core/offscreencanvas/OffscreenCanvas.h" | 
|    6  |    6  | 
|    7 #include <memory> |    7 #include <memory> | 
|    8 #include "core/dom/ExceptionCode.h" |    8 #include "core/dom/ExceptionCode.h" | 
|    9 #include "core/dom/ExecutionContext.h" |    9 #include "core/dom/ExecutionContext.h" | 
|   10 #include "core/fileapi/Blob.h" |   10 #include "core/fileapi/Blob.h" | 
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  123   if (!size.Width() || !size.Height()) { |  123   if (!size.Width() || !size.Height()) { | 
|  124     *status = kZeroSizeCanvasSourceImageStatus; |  124     *status = kZeroSizeCanvasSourceImageStatus; | 
|  125     return nullptr; |  125     return nullptr; | 
|  126   } |  126   } | 
|  127   RefPtr<Image> image = context_->GetImage(hint, reason); |  127   RefPtr<Image> image = context_->GetImage(hint, reason); | 
|  128   if (!image) { |  128   if (!image) { | 
|  129     *status = kInvalidSourceImageStatus; |  129     *status = kInvalidSourceImageStatus; | 
|  130   } else { |  130   } else { | 
|  131     *status = kNormalSourceImageStatus; |  131     *status = kNormalSourceImageStatus; | 
|  132   } |  132   } | 
|  133   return image.Release(); |  133   return image; | 
|  134 } |  134 } | 
|  135  |  135  | 
|  136 IntSize OffscreenCanvas::BitmapSourceSize() const { |  136 IntSize OffscreenCanvas::BitmapSourceSize() const { | 
|  137   return size_; |  137   return size_; | 
|  138 } |  138 } | 
|  139  |  139  | 
|  140 ScriptPromise OffscreenCanvas::CreateImageBitmap( |  140 ScriptPromise OffscreenCanvas::CreateImageBitmap( | 
|  141     ScriptState* script_state, |  141     ScriptState* script_state, | 
|  142     EventTarget&, |  142     EventTarget&, | 
|  143     Optional<IntRect> crop_rect, |  143     Optional<IntRect> crop_rect, | 
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  409 } |  409 } | 
|  410  |  410  | 
|  411 DEFINE_TRACE(OffscreenCanvas) { |  411 DEFINE_TRACE(OffscreenCanvas) { | 
|  412   visitor->Trace(context_); |  412   visitor->Trace(context_); | 
|  413   visitor->Trace(execution_context_); |  413   visitor->Trace(execution_context_); | 
|  414   visitor->Trace(commit_promise_resolver_); |  414   visitor->Trace(commit_promise_resolver_); | 
|  415   EventTargetWithInlineData::Trace(visitor); |  415   EventTargetWithInlineData::Trace(visitor); | 
|  416 } |  416 } | 
|  417  |  417  | 
|  418 }  // namespace blink |  418 }  // namespace blink | 
| OLD | NEW |