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

Side by Side Diff: sky/shell/gpu/ganesh_surface.cc

Issue 1183213007: Fix offscreen rendering on iOS by not assuming that the default window bound framebuffer is 0 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "sky/shell/gpu/ganesh_surface.h" 5 #include "sky/shell/gpu/ganesh_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/skia/include/gpu/GrContext.h" 8 #include "third_party/skia/include/gpu/GrContext.h"
9 9
10 namespace sky { 10 namespace sky {
11 namespace shell { 11 namespace shell {
12 12
13 GaneshSurface::GaneshSurface(GaneshContext* context, const gfx::Size& size) { 13 GaneshSurface::GaneshSurface(intptr_t window_fbo,
14 GaneshContext* context,
15 const gfx::Size& size) {
14 GrBackendRenderTargetDesc desc; 16 GrBackendRenderTargetDesc desc;
15 desc.fWidth = size.width(); 17 desc.fWidth = size.width();
16 desc.fHeight = size.height(); 18 desc.fHeight = size.height();
17 desc.fConfig = kSkia8888_GrPixelConfig; 19 desc.fConfig = kSkia8888_GrPixelConfig;
18 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; 20 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
21 desc.fRenderTargetHandle = window_fbo;
19 22
20 auto target = skia::AdoptRef(context->gr()->wrapBackendRenderTarget(desc)); 23 auto target = skia::AdoptRef(context->gr()->wrapBackendRenderTarget(desc));
21 DCHECK(target); 24 DCHECK(target);
22 surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get())); 25 surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get()));
23 DCHECK(surface_); 26 DCHECK(surface_);
24 } 27 }
25 28
26 GaneshSurface::~GaneshSurface() { 29 GaneshSurface::~GaneshSurface() {
27 } 30 }
28 31
29 } // namespace shell 32 } // namespace shell
30 } // namespace sky 33 } // namespace sky
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698