Improve off-screen rendering behavior (issue #1257).

- The |dirtyRects| argument to CefRenderHandler::OnPaint is now a single rectangle representing the union of all dirty rectangles since the last frame was generated. In most cases this rectangle will be smaller than the view (frame) size.
- cefclient: Use a ScopedGLContext class on all platforms to manage the current GL context and avoid GL state leaks.
- cefclient: Add debug checks in ClientOSRenderer for GL errors and fix some errors that were discovered.
- cefclient: Add a new `--show-update-rect` command-line flag that provides visualization of the update rectangle by drawing a red border around it for each frame.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1945 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2014-12-02 11:23:57 +00:00
parent cbae1994ae
commit b12e172af0
15 changed files with 299 additions and 116 deletions

View File

@@ -249,26 +249,32 @@ class CefRenderWidgetHostViewOSR
// Implementation based on RendererOverridesHandler::InnerSwapCompositorFrame
// and DelegatedFrameHost::CopyFromCompositingSurface.
void GenerateFrame(bool force_frame);
void GenerateFrame(bool force_frame, const gfx::Rect& damage_rect);
void InternalGenerateFrame();
void CopyFromCompositingSurfaceHasResult(
const gfx::Rect& damage_rect,
scoped_ptr<cc::CopyOutputResult> result);
void PrepareTextureCopyOutputResult(
const gfx::Rect& damage_rect,
scoped_ptr<cc::CopyOutputResult> result);
static void CopyFromCompositingSurfaceFinishedProxy(
base::WeakPtr<CefRenderWidgetHostViewOSR> view,
scoped_ptr<cc::SingleReleaseCallback> release_callback,
const gfx::Rect& damage_rect,
scoped_ptr<SkBitmap> bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
bool result);
void CopyFromCompositingSurfaceFinished(
const gfx::Rect& damage_rect,
scoped_ptr<SkBitmap> bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
bool result);
void PrepareBitmapCopyOutputResult(
const gfx::Rect& damage_rect,
scoped_ptr<cc::CopyOutputResult> result);
void OnFrameCaptureFailure();
void OnFrameCaptureFailure(const gfx::Rect& damage_rect);
void OnFrameCaptureSuccess(
const gfx::Rect& damage_rect,
const SkBitmap& bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock);
void OnFrameCaptureCompletion(bool force_frame);
@@ -323,6 +329,7 @@ class CefRenderWidgetHostViewOSR
bool frame_in_progress_;
int frame_retry_count_;
scoped_ptr<SkBitmap> bitmap_;
gfx::Rect pending_damage_rect_;
bool hold_resize_;
bool pending_resize_;