| 
385 | 385 | <a href="#384" id="384">384</a>  | 
386 | 386 | <a href="#385" id="385">385</a>  | 
387 | 387 | <a href="#386" id="386">386</a>  | 
388 |  | -<a href="#387" id="387">387</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{error, fmt};  | 
 | 388 | +<a href="#387" id="387">387</a>  | 
 | 389 | +<a href="#388" id="388">388</a>  | 
 | 390 | +<a href="#389" id="389">389</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{error, fmt};  | 
389 | 391 | 
 
  | 
390 | 392 | <span class="kw">use </span>parking_lot::Mutex;  | 
391 | 393 | <span class="kw">use </span>raw_window_handle::{HasDisplayHandle, HasWindowHandle};  | 
 | 
410 | 412 | /// [`GPUCanvasContext`](https://gpuweb.github.io/gpuweb/#canvas-context)  | 
411 | 413 | /// serves a similar role.  | 
412 | 414 | </span><span class="kw">pub struct </span>Surface<<span class="lifetime">'window</span>> {  | 
413 |  | -    <span class="doccomment">/// Optionally, keep the source of the handle used for the surface alive.  | 
414 |  | -    ///  | 
415 |  | -    /// This is useful for platforms where the surface is created from a window and the surface  | 
416 |  | -    /// would become invalid when the window is dropped.  | 
417 |  | -    </span><span class="kw">pub</span>(<span class="kw">crate</span>) _handle_source: <span class="prelude-ty">Option</span><Box<<span class="kw">dyn </span>WindowHandle + <span class="lifetime">'window</span>>>,  | 
418 |  | - | 
419 | 415 |     <span class="doccomment">/// Additional surface data returned by [`DynContext::instance_create_surface`].  | 
420 | 416 |     </span><span class="kw">pub</span>(<span class="kw">crate</span>) inner: dispatch::DispatchSurface,  | 
421 | 417 | 
 
  | 
 | 
426 | 422 |     // be wrapped in a mutex and since the configuration is only supplied after the surface has  | 
427 | 423 |     // been created is is additionally wrapped in an option.  | 
428 | 424 |     </span><span class="kw">pub</span>(<span class="kw">crate</span>) config: Mutex<<span class="prelude-ty">Option</span><SurfaceConfiguration>>,  | 
 | 425 | + | 
 | 426 | +    <span class="doccomment">/// Optionally, keep the source of the handle used for the surface alive.  | 
 | 427 | +    ///  | 
 | 428 | +    /// This is useful for platforms where the surface is created from a window and the surface  | 
 | 429 | +    /// would become invalid when the window is dropped.  | 
 | 430 | +    ///  | 
 | 431 | +    /// SAFETY: This field must be dropped *after* all other fields to ensure proper cleanup.  | 
 | 432 | +    </span><span class="kw">pub</span>(<span class="kw">crate</span>) _handle_source: <span class="prelude-ty">Option</span><Box<<span class="kw">dyn </span>WindowHandle + <span class="lifetime">'window</span>>>,  | 
429 | 433 | }  | 
430 | 434 | 
 
  | 
431 | 435 | <span class="kw">impl </span>Surface<<span class="lifetime">'_</span>> {  | 
 | 
0 commit comments