Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an `Unserializable` type to utils #9379

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Use the new `Unserializable` structure in canvas' `FromPaintMsg`.

  • Loading branch information
emilio committed Jan 19, 2016
commit 3c452c3acc0f3a2b9a04b24678153bcfe3004f2b
@@ -196,7 +196,7 @@ impl<'a> CanvasPaintThread<'a> {
}
}
CanvasMsg::FromPaint(message) => {
match message {
match message.get() {
FromPaintMsg::SendNativeSurface(chan) => {
painter.send_native_surface(chan)
}
@@ -222,7 +222,7 @@ impl WebGLPaintThread {
}
}
CanvasMsg::FromPaint(message) => {
match message {
match message.get() {
FromPaintMsg::SendNativeSurface(chan) =>
painter.send_native_surface(chan),
}
@@ -35,11 +35,11 @@ use gfx_traits::color;
use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
use layers::platform::surface::NativeSurface;
use offscreen_gl_context::GLContextAttributes;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::default::Default;
use std::fmt;
use std::str::FromStr;
use std::sync::mpsc::Sender;
use util::ipc::Unserializable;
use util::mem::HeapSizeOf;

#[derive(Clone, Deserialize, Serialize)]
@@ -53,7 +53,7 @@ pub enum CanvasMsg {
Canvas2d(Canvas2dMsg),
Common(CanvasCommonMsg),
FromLayout(FromLayoutMsg),
FromPaint(FromPaintMsg),
FromPaint(Unserializable<FromPaintMsg>),
WebGL(CanvasWebGLMsg),
}

@@ -73,18 +73,6 @@ pub enum FromPaintMsg {
SendNativeSurface(Sender<NativeSurface>),
}

impl Serialize for FromPaintMsg {
fn serialize<S>(&self, _: &mut S) -> Result<(), S::Error> where S: Serializer {
panic!("can't serialize a `FromPaintMsg`!")
}
}

impl Deserialize for FromPaintMsg {
fn deserialize<D>(_: &mut D) -> Result<FromPaintMsg, D::Error> where D: Deserializer {
panic!("can't deserialize a `FromPaintMsg`!")
}
}

#[derive(Clone, Deserialize, Serialize)]
pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool),
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.