1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "src/gpu/graphite/ClearBuffersTask.h" 9 10 #include "src/gpu/graphite/CommandBuffer.h" 11 12 namespace skgpu::graphite { 13 Make(std::vector<ClearBufferInfo> clearList)14sk_sp<ClearBuffersTask> ClearBuffersTask::Make(std::vector<ClearBufferInfo> clearList) { 15 return sk_sp<ClearBuffersTask>(new ClearBuffersTask(std::move(clearList))); 16 } 17 ~ClearBuffersTask()18ClearBuffersTask::~ClearBuffersTask(){}; 19 addCommands(Context *,CommandBuffer * commandBuffer,ReplayTargetData)20bool ClearBuffersTask::addCommands(Context*, CommandBuffer* commandBuffer, ReplayTargetData) { 21 bool result = true; 22 for (const auto& c : fClearList) { 23 result &= commandBuffer->clearBuffer(c.fBuffer, c.fOffset, c.fSize); 24 } 25 return result; 26 } 27 28 } // namespace skgpu::graphite 29