-
Notifications
You must be signed in to change notification settings - Fork 6k
Move common graphics utils to //flutter/common/graphics #22320
Conversation
@stuartmorgan , I eventually plan on creating |
graphics/BUILD.gn
Outdated
"//flutter/shell/version:version", | ||
"//third_party/rapidjson", | ||
"//third_party/skia", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this have public_configs = [ "//flutter:config" ]
like most other targets?
graphics/persistent_cache.cc
Outdated
@@ -2,7 +2,7 @@ | |||
// Use of this source code is governed by a BSD-style license that can be | |||
// found in the LICENSE file. | |||
|
|||
#include "flutter/shell/common/persistent_cache.h" | |||
#include "flutter/graphics/persistent_cache.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not wild about having flutter/graphics have a dependency into flutter/shell (for version). I know version is essentially self-contained, but shell/* is exactly what we don't want embeddings built on embedder.h to have arbitrary dependencies into. That's the whole reason for this move, after all.
I think we need a clearer definition of what dependencies are allowable, and a directory structure that makes the line much crisper. (I really wish we had Chromium's tooling for whitelisting/blacklisting cross-directory dependencies set up.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I was contemplating moving version
out of shell to flutter root. Do you think that would make things easier to reason about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how many things we want to move to the root; these two things are probably not going to be the last things we want to share.
I'm increasingly thinking we should instead have a new directory in shell, something like shell/embedding_utils
(it's not a great name, but naming it is non-trivial, especially given the existing common
, which now isn't), and make that the firewall, and put graphics
and version
in there, along with an explanatory README.
I'll workshop a name in the engine channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stuartmorgan given that this will likely take some thinking. I'd like to not let this PR go stale. We can always move this folder to the right home once we decide on it. I've also added a warning message in the gn file to not add additional deps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is that this gives the appearance of being isolated from shell/ by moving out of shell, but since it actually does depend back into shell that's not actually the case.
Even if we don't think this is a final location, what's the argument for having the interim location be both top-level and having dependencies into shell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will move this into //flutter/shell/graphics/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of //flutter/common/graphics
so we don't inflate the root? Maybe version
can also go there as both of them don't seem to rely on shell
to exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving gl_context_switch, texture, persistent_cache
into graphics
makes sense to me. @flar and I were also discussing where to put common graphics code shared between flow
and lib/ui
. I guess graphics
would be a nice place once this lands.
deeb293
to
81d246d
Compare
@stuartmorgan , @liyuqian I've moved it to |
81d246d
to
1158ee9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the header guards are fixed.
common/graphics/persistent_cache.h
Outdated
@@ -2,8 +2,8 @@ | |||
// Use of this source code is governed by a BSD-style license that can be | |||
// found in the LICENSE file. | |||
|
|||
#ifndef FLUTTER_SHELL_COMMON_PERSISTENT_CACHE_H_ | |||
#define FLUTTER_SHELL_COMMON_PERSISTENT_CACHE_H_ | |||
#ifndef FLUTTER_GRAPHICS_PERSISTENT_CACHE_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the header guards need updating again.
1158ee9
to
8a16d19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. BTW, some include
needs to be reordered. For example
-#include "flutter/fml/logging.h"
#include "flutter/common/graphics/persistent_cache.h"
+#include "flutter/fml/logging.h"
This change creates a new source set //flutter/common/graphics with minimal dependencies. The intention with this target is to be later consumed in a darwin common graphics target across the desktop boundary. Also unifies some of the graphics utilities under the same folder.
8a16d19
to
7980b4a
Compare
* 03e750d Roll Fuchsia Linux SDK from g6EuxMthn... to DzZi2gPbF... (flutter/engine#22417) * 80e9a3f Roll Skia from 84d503b21322 to 5b8598952931 (7 revisions) (flutter/engine#22418) * 80cc0fa Roll Skia from 5b8598952931 to 02dd0ed8ce5e (1 revision) (flutter/engine#22419) * d14c4a7 Roll Skia from 02dd0ed8ce5e to fb5850f41043 (4 revisions) (flutter/engine#22420) * af185be Roll Skia from fb5850f41043 to 008d63e23dab (6 revisions) (flutter/engine#22421) * 1a13dac Simplify API for scheduling Skia object deletions (flutter/engine#22409) * 49299c3 Roll Skia from 008d63e23dab to 267826c86552 (4 revisions) (flutter/engine#22422) * 25e0829 Roll Fuchsia Mac SDK from w10eytxvc... to e-4Jm-yWa... (flutter/engine#22423) * 76e6158 Roll Skia from 267826c86552 to 88e8bb2fe2d5 (3 revisions) (flutter/engine#22424) * caf678d Move common graphics utils to //flutter/common/graphics (flutter/engine#22320)
Uh oh!
There was an error while loading. Please reload this page.