| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" | 5 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC
ontextOrWebGL2RenderingContext.h" | 7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC
ontextOrWebGL2RenderingContext.h" |
| 8 #include "core/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/workers/WorkerGlobalScope.h" | 10 #include "core/workers/WorkerGlobalScope.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 void OffscreenCanvasRenderingContext2D::didDraw(const SkIRect& dirtyRect) {} | 218 void OffscreenCanvasRenderingContext2D::didDraw(const SkIRect& dirtyRect) {} |
| 219 | 219 |
| 220 bool OffscreenCanvasRenderingContext2D::stateHasFilter() { | 220 bool OffscreenCanvasRenderingContext2D::stateHasFilter() { |
| 221 // TODO: crbug.com/593838 make hasFilter accept nullptr | 221 // TODO: crbug.com/593838 make hasFilter accept nullptr |
| 222 // return state().hasFilter(nullptr, nullptr, IntSize(width(), height()), | 222 // return state().hasFilter(nullptr, nullptr, IntSize(width(), height()), |
| 223 // this); | 223 // this); |
| 224 return false; | 224 return false; |
| 225 } | 225 } |
| 226 | 226 |
| 227 SkImageFilter* OffscreenCanvasRenderingContext2D::stateGetFilter() { | 227 sk_sp<SkImageFilter> OffscreenCanvasRenderingContext2D::stateGetFilter() { |
| 228 // TODO: make getFilter accept nullptr | 228 // TODO: make getFilter accept nullptr |
| 229 // return state().getFilter(nullptr, nullptr, IntSize(width(), height()), | 229 // return state().getFilter(nullptr, nullptr, IntSize(width(), height()), |
| 230 // this); | 230 // this); |
| 231 return nullptr; | 231 return nullptr; |
| 232 } | 232 } |
| 233 | 233 |
| 234 void OffscreenCanvasRenderingContext2D::validateStateStack() const { | 234 void OffscreenCanvasRenderingContext2D::validateStateStack() const { |
| 235 #if DCHECK_IS_ON() | 235 #if DCHECK_IS_ON() |
| 236 if (SkCanvas* skCanvas = existingDrawingCanvas()) { | 236 if (SkCanvas* skCanvas = existingDrawingCanvas()) { |
| 237 DCHECK_EQ(static_cast<size_t>(skCanvas->getSaveCount()), | 237 DCHECK_EQ(static_cast<size_t>(skCanvas->getSaveCount()), |
| 238 m_stateStack.size() + 1); | 238 m_stateStack.size() + 1); |
| 239 } | 239 } |
| 240 #endif | 240 #endif |
| 241 } | 241 } |
| 242 | 242 |
| 243 bool OffscreenCanvasRenderingContext2D::isContextLost() const { | 243 bool OffscreenCanvasRenderingContext2D::isContextLost() const { |
| 244 return false; | 244 return false; |
| 245 } | 245 } |
| 246 | 246 |
| 247 bool OffscreenCanvasRenderingContext2D::isPaintable() const { | 247 bool OffscreenCanvasRenderingContext2D::isPaintable() const { |
| 248 return this->imageBuffer(); | 248 return this->imageBuffer(); |
| 249 } | 249 } |
| 250 } | 250 } |
| OLD | NEW |