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

Side by Side Diff: android_webview/browser/in_process_renderer/in_process_view_renderer.cc

Issue 14600002: HW draw workarounds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixups to force hw with this patch Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | android_webview/lib/main/aw_main_delegate.cc » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "android_webview/browser/in_process_renderer/in_process_view_renderer.h " 5 #include "android_webview/browser/in_process_renderer/in_process_view_renderer.h "
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "android_webview/public/browser/draw_gl.h" 9 #include "android_webview/public/browser/draw_gl.h"
10 #include "android_webview/public/browser/draw_sw.h" 10 #include "android_webview/public/browser/draw_sw.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 web_contents_->SetUserData(kUserDataKey, new UserData(this)); 175 web_contents_->SetUserData(kUserDataKey, new UserData(this));
176 } 176 }
177 177
178 void InProcessViewRenderer::WebContentsGone() { 178 void InProcessViewRenderer::WebContentsGone() {
179 web_contents_ = NULL; 179 web_contents_ = NULL;
180 } 180 }
181 181
182 bool InProcessViewRenderer::PrepareDrawGL(int x, int y) { 182 bool InProcessViewRenderer::PrepareDrawGL(int x, int y) {
183 // No harm in updating |hw_rendering_scroll_| even if we return false. 183 // No harm in updating |hw_rendering_scroll_| even if we return false.
184 hw_rendering_scroll_ = gfx::Point(x, y); 184 hw_rendering_scroll_ = gfx::Point(x, y);
185 return attached_to_window_ && compositor_ && compositor_->IsHwReady() && 185 return attached_to_window_ && compositor_ && !hardware_failed_;
186 !hardware_failed_;
187 } 186 }
188 187
189 void InProcessViewRenderer::DrawGL(AwDrawGLInfo* draw_info) { 188 void InProcessViewRenderer::DrawGL(AwDrawGLInfo* draw_info) {
190 DCHECK(view_visible_); 189 DCHECK(view_visible_);
191 190
192 // We need to watch if the current Android context has changed and enforce 191 // We need to watch if the current Android context has changed and enforce
193 // a clean-up in the compositor. 192 // a clean-up in the compositor.
194 EGLContext current_context = eglGetCurrentContext(); 193 EGLContext current_context = eglGetCurrentContext();
195 if (!current_context) { 194 if (!current_context) {
196 LOG(WARNING) << "No current context attached. Skipping composite."; 195 LOG(WARNING) << "No current context attached. Skipping composite.";
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page 422 // TODO(joth): BrowserViewRendererImpl had a bunch of logic for dpi and page
424 // scale here. Determine what if any needs bringing over to this class. 423 // scale here. Determine what if any needs bringing over to this class.
425 return CompositeSW(canvas); 424 return CompositeSW(canvas);
426 } 425 }
427 426
428 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) { 427 bool InProcessViewRenderer::CompositeSW(SkCanvas* canvas) {
429 return compositor_ && compositor_->DemandDrawSw(canvas); 428 return compositor_ && compositor_->DemandDrawSw(canvas);
430 } 429 }
431 430
432 } // namespace android_webview 431 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/lib/main/aw_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698