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

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

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
« no previous file with comments | « no previous file | sky/shell/gpu/ganesh_surface.cc » ('j') | ui/gl/gl_surface_ios.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef SKY_SHELL_GPU_GANESH_SURFACE_H_ 5 #ifndef SKY_SHELL_GPU_GANESH_SURFACE_H_
6 #define SKY_SHELL_GPU_GANESH_SURFACE_H_ 6 #define SKY_SHELL_GPU_GANESH_SURFACE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "skia/ext/refptr.h" 9 #include "skia/ext/refptr.h"
10 #include "sky/shell/gpu/ganesh_context.h" 10 #include "sky/shell/gpu/ganesh_context.h"
11 #include "third_party/skia/include/core/SkSurface.h" 11 #include "third_party/skia/include/core/SkSurface.h"
12 #include "ui/gfx/geometry/size.h" 12 #include "ui/gfx/geometry/size.h"
13 13
14 namespace sky { 14 namespace sky {
15 namespace shell { 15 namespace shell {
16 16
17 // GaneshSurface holds an SkSurface configured to render with Ganesh. Using the 17 // GaneshSurface holds an SkSurface configured to render with Ganesh. Using the
18 // provided GaneshContext, GaneshSurface wraps an SkSurface around FBO 0 so that 18 // provided GaneshContext, GaneshSurface wraps an SkSurface around the window
19 // you can use |canvas()| to draw to FBO 0. 19 // bound FBO so that you can use |canvas()| to draw to that window bound FBO.
20 class GaneshSurface { 20 class GaneshSurface {
21 public: 21 public:
22 GaneshSurface(GaneshContext* context, const gfx::Size& size); 22 GaneshSurface(intptr_t window_fbo,
23 GaneshContext* context,
24 const gfx::Size& size);
23 ~GaneshSurface(); 25 ~GaneshSurface();
24 26
25 SkCanvas* canvas() const { return surface_->getCanvas(); } 27 SkCanvas* canvas() const { return surface_->getCanvas(); }
26 gfx::Size size() const { 28 gfx::Size size() const {
27 return gfx::Size(surface_->width(), surface_->height()); 29 return gfx::Size(surface_->width(), surface_->height());
28 } 30 }
29 31
30 private: 32 private:
31 skia::RefPtr<SkSurface> surface_; 33 skia::RefPtr<SkSurface> surface_;
32 34
33 DISALLOW_COPY_AND_ASSIGN(GaneshSurface); 35 DISALLOW_COPY_AND_ASSIGN(GaneshSurface);
34 }; 36 };
35 37
36 } // namespace shell 38 } // namespace shell
37 } // namespace sky 39 } // namespace sky
38 40
39 #endif // SKY_SHELL_GPU_GANESH_SURFACE_H_ 41 #endif // SKY_SHELL_GPU_GANESH_SURFACE_H_
OLDNEW
« no previous file with comments | « no previous file | sky/shell/gpu/ganesh_surface.cc » ('j') | ui/gl/gl_surface_ios.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698