Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: mojo/skia/ganesh_texture_surface.cc

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/skia/ganesh_texture_surface.h ('k') | mojo/skia/gl_bindings_skia.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/skia/ganesh_texture_surface.h" 5 #include "mojo/skia/ganesh_texture_surface.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/gpu/gl_texture.h" 10 #include "mojo/gpu/gl_texture.h"
(...skipping 16 matching lines...) Expand all
27 27
28 GrBackendTextureDesc desc; 28 GrBackendTextureDesc desc;
29 desc.fFlags = kRenderTarget_GrBackendTextureFlag; 29 desc.fFlags = kRenderTarget_GrBackendTextureFlag;
30 desc.fOrigin = kTopLeft_GrSurfaceOrigin; 30 desc.fOrigin = kTopLeft_GrSurfaceOrigin;
31 desc.fWidth = texture_->size().width; 31 desc.fWidth = texture_->size().width;
32 desc.fHeight = texture_->size().height; 32 desc.fHeight = texture_->size().height;
33 desc.fConfig = kSkia8888_GrPixelConfig; 33 desc.fConfig = kSkia8888_GrPixelConfig;
34 desc.fSampleCnt = 0; 34 desc.fSampleCnt = 0;
35 desc.fTextureHandle = reinterpret_cast<GrBackendObject>(&info); 35 desc.fTextureHandle = reinterpret_cast<GrBackendObject>(&info);
36 36
37 surface_ = ::skia::AdoptRef(SkSurface::NewFromBackendTexture( 37 surface_ = SkSurface::MakeFromBackendTexture(scope.gr_context().get(), desc,
38 scope.gr_context().get(), desc, nullptr)); 38 nullptr);
39 DCHECK(surface_); 39 DCHECK(surface_);
40 } 40 }
41 41
42 GaneshTextureSurface::~GaneshTextureSurface() {} 42 GaneshTextureSurface::~GaneshTextureSurface() {}
43 43
44 std::unique_ptr<GLTexture> GaneshTextureSurface::TakeTexture() { 44 std::unique_ptr<GLTexture> GaneshTextureSurface::TakeTexture() {
45 surface_->getCanvas()->flush(); 45 surface_->getCanvas()->flush();
46 surface_.clear(); 46 surface_.reset();
47 return std::move(texture_); 47 return std::move(texture_);
48 } 48 }
49 49
50 } // namespace skia 50 } // namespace skia
51 } // namespace mojo 51 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/skia/ganesh_texture_surface.h ('k') | mojo/skia/gl_bindings_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698