Currently, feature-based visual Simultaneous Localization and Mapping (SLAM) has reached a mature stage. Feature-based visual SLAM systems usually calculate the camera poses without producing a dense surface, even if a depth camera are provided. In contrast, dense SLAM systems simultaneously output camera poses as well as a dense surface of the reconstruction region. In this paper, we propose a new RGB-D dense SLAM system. First, camera pose is calculated by minimizing the combination of the reprojection error and the dense geometric error. We construct a new type of edge in g2o, which adds the extra constraints built with the dense geometric error to the graph optimization. The cost function is minimized in a coarse-to-fine strategy with GPU which contributes to the enhancement of system frame rate and promotion of large camera motion convergence. Second, in order to generate dense surfaces and provide users with a feedback of the scanned surfaces, we use the surfel model to fuse RGB-D streams and generated dense surface models in real-time. The surfels in the dense model are updated with embedded deformation graph to keep them consistent with the optimized camera poses after the system performs essential graph optimization and full Bundle Adjustment (BA). Third, a better 3D model is achieved by re-merging the stream with the optimized camera poses when the user ends the reconstruction. We compare the accuracy of generated camera trajectories and reconstruction surfaces with the state-of-the-art systems based on the TUM and ICL-NIUM RGB-D benchmark datasets. Experimental results show that the accuracy of dense surfaces produced online is very close to that of later re-fusion. And our system produces better results than the state-of-the-art systems in terms of the accuracy of the produced camera trajectories.