| Flutter Impeller |

texture_mipmap.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "impeller/renderer/texture_mipmap.h"
6 #include "impeller/renderer/blit_pass.h"
7 #include "impeller/renderer/command_buffer.h"
8
9 namespace impeller {
10
11 fml::Status AddMipmapGeneration(
12 const std::shared_ptr<CommandBuffer>& command_buffer,
13 const std::shared_ptr<Context>& context,
14 const std::shared_ptr<Texture>& texture) {
15 std::shared_ptr<BlitPass> blit_pass = command_buffer->CreateBlitPass();
16 bool success = blit_pass->GenerateMipmap(texture);
17 if (!success) {
18 return fml::Status(fml::StatusCode::kUnknown, "");
19 }
20 success = blit_pass->EncodeCommands(context->GetResourceAllocator());
21 if (!success) {
22 return fml::Status(fml::StatusCode::kUnknown, "");
23 }
24 return fml::Status();
25 }
26
27 } // namespace impeller
impeller::AddMipmapGeneration
fml::Status AddMipmapGeneration(const std::shared_ptr< CommandBuffer > &command_buffer, const std::shared_ptr< Context > &context, const std::shared_ptr< Texture > &texture)
Adds a blit command to the render pass.
Definition: texture_mipmap.cc:11
texture_mipmap.h
blit_pass.h
command_buffer.h
impeller
Definition: aiks_blur_unittests.cc:20