| 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 "platform/graphics/AcceleratedStaticBitmapImage.h" | 5 #include "platform/graphics/AcceleratedStaticBitmapImage.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_interface.h" | 7 #include "gpu/command_buffer/client/gles2_interface.h" |
| 8 #include "gpu/command_buffer/common/sync_token.h" | 8 #include "gpu/command_buffer/common/sync_token.h" |
| 9 #include "platform/graphics/MailboxTextureHolder.h" | 9 #include "platform/graphics/MailboxTextureHolder.h" |
| 10 #include "platform/graphics/SkiaTextureHolder.h" | 10 #include "platform/graphics/SkiaTextureHolder.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const ColorBehavior& colorBehavior) { | 93 const ColorBehavior& colorBehavior) { |
| 94 // TODO(ccameron): This function should not ignore |colorBehavior|. | 94 // TODO(ccameron): This function should not ignore |colorBehavior|. |
| 95 // https://crbug.com/672306 | 95 // https://crbug.com/672306 |
| 96 checkThread(); | 96 checkThread(); |
| 97 if (!isValid()) | 97 if (!isValid()) |
| 98 return nullptr; | 98 return nullptr; |
| 99 createImageFromMailboxIfNeeded(); | 99 createImageFromMailboxIfNeeded(); |
| 100 return m_textureHolder->skImage(); | 100 return m_textureHolder->skImage(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void AcceleratedStaticBitmapImage::draw(SkCanvas* canvas, | 103 void AcceleratedStaticBitmapImage::draw(PaintCanvas* canvas, |
| 104 const SkPaint& paint, | 104 const PaintFlags& paint, |
| 105 const FloatRect& dstRect, | 105 const FloatRect& dstRect, |
| 106 const FloatRect& srcRect, | 106 const FloatRect& srcRect, |
| 107 RespectImageOrientationEnum, | 107 RespectImageOrientationEnum, |
| 108 ImageClampingMode imageClampingMode, | 108 ImageClampingMode imageClampingMode, |
| 109 const ColorBehavior& colorBehavior) { | 109 const ColorBehavior& colorBehavior) { |
| 110 // TODO(ccameron): This function should not ignore |colorBehavior|. | 110 // TODO(ccameron): This function should not ignore |colorBehavior|. |
| 111 // https://crbug.com/672306 | 111 // https://crbug.com/672306 |
| 112 checkThread(); | 112 checkThread(); |
| 113 if (!isValid()) | 113 if (!isValid()) |
| 114 return; | 114 return; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 void AcceleratedStaticBitmapImage::checkThread() { | 174 void AcceleratedStaticBitmapImage::checkThread() { |
| 175 if (m_detachThreadAtNextCheck) { | 175 if (m_detachThreadAtNextCheck) { |
| 176 m_threadChecker.DetachFromThread(); | 176 m_threadChecker.DetachFromThread(); |
| 177 m_detachThreadAtNextCheck = false; | 177 m_detachThreadAtNextCheck = false; |
| 178 } | 178 } |
| 179 CHECK(m_threadChecker.CalledOnValidThread()); | 179 CHECK(m_threadChecker.CalledOnValidThread()); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace blink | 182 } // namespace blink |
| OLD | NEW |