Remove ~SurfaceFrame (flutter/engine#32915)
This commit is contained in:
@@ -197,6 +197,7 @@ FILE: ../../../flutter/flow/surface.cc
|
||||
FILE: ../../../flutter/flow/surface.h
|
||||
FILE: ../../../flutter/flow/surface_frame.cc
|
||||
FILE: ../../../flutter/flow/surface_frame.h
|
||||
FILE: ../../../flutter/flow/surface_frame_unittests.cc
|
||||
FILE: ../../../flutter/flow/texture_unittests.cc
|
||||
FILE: ../../../flutter/fml/ascii_trie.cc
|
||||
FILE: ../../../flutter/fml/ascii_trie.h
|
||||
|
||||
@@ -162,6 +162,7 @@ if (enable_unittests) {
|
||||
"raster_cache_unittests.cc",
|
||||
"rtree_unittests.cc",
|
||||
"skia_gpu_object_unittests.cc",
|
||||
"surface_frame_unittests.cc",
|
||||
"testing/auto_save_layer_unittests.cc",
|
||||
"testing/mock_layer_unittests.cc",
|
||||
"testing/mock_texture_unittests.cc",
|
||||
|
||||
@@ -33,13 +33,6 @@ SurfaceFrame::SurfaceFrame(sk_sp<SkSurface> surface,
|
||||
}
|
||||
}
|
||||
|
||||
SurfaceFrame::~SurfaceFrame() {
|
||||
if (submit_callback_ && !submitted_) {
|
||||
// Dropping without a Submit.
|
||||
submit_callback_(*this, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
bool SurfaceFrame::Submit() {
|
||||
if (submitted_) {
|
||||
return false;
|
||||
|
||||
@@ -59,8 +59,6 @@ class SurfaceFrame {
|
||||
std::unique_ptr<GLContextResult> context_result = nullptr,
|
||||
bool display_list_fallback = false);
|
||||
|
||||
~SurfaceFrame();
|
||||
|
||||
struct SubmitInfo {
|
||||
// The frame damage for frame n is the difference between frame n and
|
||||
// frame (n-1), and represents the area that a compositor must recompose.
|
||||
|
||||
23
engine/src/flutter/flow/surface_frame_unittests.cc
Normal file
23
engine/src/flutter/flow/surface_frame_unittests.cc
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#define FML_USED_ON_EMBEDDER
|
||||
|
||||
#include "flutter/flow/surface_frame.h"
|
||||
#include "flutter/testing/testing.h"
|
||||
|
||||
namespace flutter {
|
||||
|
||||
TEST(FlowTest, SurfaceFrameDoesNotSubmitInDtor) {
|
||||
SurfaceFrame::FramebufferInfo framebuffer_info;
|
||||
auto surface_frame = std::make_unique<SurfaceFrame>(
|
||||
/*surface=*/nullptr, framebuffer_info,
|
||||
/*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) {
|
||||
EXPECT_FALSE(true);
|
||||
return true;
|
||||
});
|
||||
surface_frame.reset();
|
||||
}
|
||||
|
||||
} // namespace flutter
|
||||
Reference in New Issue
Block a user