forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android can put the webview into an FBO, and compositor should draw into the FBO instead of directly on screen. Use AwGLSurface and explicitly set the FBO at the beginning of each hardware draw. Add new APIs in GLInProcessContext and WGC3DIPCBI to allow the underlying GLSurface to be created separately. BUG=251501 Review URL: https://chromiumcodereview.appspot.com/22277004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216136 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
boliu@chromium.org
committed
Aug 7, 2013
1 parent
ddafdb6
commit 6172484
Showing
18 changed files
with
447 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "android_webview/browser/aw_gl_surface.h" | ||
|
||
namespace android_webview { | ||
|
||
AwGLSurface::AwGLSurface() : fbo_(0) {} | ||
|
||
AwGLSurface::~AwGLSurface() {} | ||
|
||
void AwGLSurface::Destroy() { | ||
} | ||
|
||
bool AwGLSurface::IsOffscreen() { | ||
return false; | ||
} | ||
|
||
unsigned int AwGLSurface::GetBackingFrameBufferObject() { | ||
return fbo_; | ||
} | ||
|
||
bool AwGLSurface::SwapBuffers() { | ||
return true; | ||
} | ||
|
||
gfx::Size AwGLSurface::GetSize() { | ||
return gfx::Size(1, 1); | ||
} | ||
|
||
void* AwGLSurface::GetHandle() { | ||
return NULL; | ||
} | ||
|
||
void* AwGLSurface::GetDisplay() { | ||
return NULL; | ||
} | ||
|
||
void AwGLSurface::SetBackingFrameBufferObject(unsigned int fbo) { | ||
fbo_ = fbo; | ||
} | ||
|
||
void AwGLSurface::ResetBackingFrameBufferObject() { | ||
fbo_ = 0; | ||
} | ||
|
||
} // namespace android_webview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ANDROID_WEBVIEW_BROWSER_AW_GL_SURFACE_H_ | ||
#define ANDROID_WEBVIEW_BROWSER_AW_GL_SURFACE_H_ | ||
|
||
#include "ui/gl/gl_surface.h" | ||
|
||
namespace android_webview { | ||
|
||
// This surface is used to represent the underlying surface provided by the App | ||
// inside a hardware draw. Note that offscreen contexts will not be using this | ||
// GLSurface. | ||
class GL_EXPORT AwGLSurface : public gfx::GLSurface { | ||
public: | ||
AwGLSurface(); | ||
|
||
// Implement GLSurface. | ||
virtual void Destroy() OVERRIDE; | ||
virtual bool IsOffscreen() OVERRIDE; | ||
virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; | ||
virtual bool SwapBuffers() OVERRIDE; | ||
virtual gfx::Size GetSize() OVERRIDE; | ||
virtual void* GetHandle() OVERRIDE; | ||
virtual void* GetDisplay() OVERRIDE; | ||
|
||
void SetBackingFrameBufferObject(unsigned int fbo); | ||
void ResetBackingFrameBufferObject(); | ||
|
||
protected: | ||
virtual ~AwGLSurface(); | ||
|
||
private: | ||
unsigned int fbo_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(AwGLSurface); | ||
}; | ||
|
||
} // namespace android_webview | ||
|
||
#endif // ANDROID_WEBVIEW_BROWSER_AW_GL_SURFACE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.