comparison Framework/Viewport/SdlViewport.cpp @ 907:722ee73e6ba2

cleanup + started to implement WebAssemblyCairoViewport (wip)
author Alain Mazy <alain@mazy.be>
date Thu, 18 Jul 2019 09:19:39 +0200
parents 88bf49aebc13
children 7a7e4e1f558f
comparison
equal deleted inserted replaced
905:88bf49aebc13 907:722ee73e6ba2
76 { 76 {
77 SDL_FreeSurface(sdlSurface_); 77 SDL_FreeSurface(sdlSurface_);
78 } 78 }
79 } 79 }
80 80
81 // void SdlCairoViewport::SetSize(unsigned int width,
82 // unsigned int height)
83 // {
84 // if (cairoSurface_.get() == NULL ||
85 // cairoSurface_->GetWidth() != width ||
86 // cairoSurface_->GetHeight() != height)
87 // {
88 // cairoSurface_.reset(new CairoSurface(width, height, false /* no alpha */));
89
90 // // TODO Big endian?
91 // static const uint32_t rmask = 0x00ff0000;
92 // static const uint32_t gmask = 0x0000ff00;
93 // static const uint32_t bmask = 0x000000ff;
94
95 // if (sdlSurface_)
96 // {
97 // SDL_FreeSurface(sdlSurface_);
98 // }
99
100 // sdlSurface_ = SDL_CreateRGBSurfaceFrom(cairoSurface_->GetBuffer(), width, height, 32,
101 // cairoSurface_->GetPitch(), rmask, gmask, bmask, 0);
102 // if (!sdlSurface_)
103 // {
104 // LOG(ERROR) << "Cannot create a SDL surface from a Cairo surface";
105 // throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
106 // }
107 // }
108 // }
109
110 81
111 void SdlCairoViewport::Refresh() 82 void SdlCairoViewport::Refresh()
112 { 83 {
113 GetCompositor().Refresh(); 84 GetCompositor().Refresh();
114 window_.Render(sdlSurface_); 85 window_.Render(sdlSurface_);
115 } 86 }
116 87
117
118 // void SdlCairoViewport::Render()
119 // {
120 // Orthanc::ImageAccessor target;
121 // compositor_.GetCanvas() cairoSurface_->GetWriteableAccessor(target);
122
123 // if (viewport.Render(target))
124 // {
125 // window_.Render(sdlSurface_);
126 // }
127 // }
128
129
130 } 88 }