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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_output_surface.cc

Issue 414503004: android: Use hw acceleration in android_webview_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "content/browser/android/in_process/synchronous_compositor_output_surfa ce.h" 5 #include "content/browser/android/in_process/synchronous_compositor_output_surfa ce.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/output/begin_frame_args.h" 9 #include "cc/output/begin_frame_args.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const gfx::Transform& transform, 199 const gfx::Transform& transform,
200 gfx::Rect viewport, 200 gfx::Rect viewport,
201 gfx::Rect clip, 201 gfx::Rect clip,
202 bool hardware_draw) { 202 bool hardware_draw) {
203 DCHECK(!invoking_composite_); 203 DCHECK(!invoking_composite_);
204 DCHECK(!frame_holder_.get()); 204 DCHECK(!frame_holder_.get());
205 base::AutoReset<bool> invoking_composite_resetter(&invoking_composite_, true); 205 base::AutoReset<bool> invoking_composite_resetter(&invoking_composite_, true);
206 206
207 gfx::Transform adjusted_transform = transform; 207 gfx::Transform adjusted_transform = transform;
208 AdjustTransform(&adjusted_transform, viewport); 208 AdjustTransform(&adjusted_transform, viewport);
209 LOG(INFO) << "external draw constr " <<
210 transform.ToString() << " viewport " << viewport.ToString() <<
211 "clip " << clip.ToString();
209 SetExternalDrawConstraints( 212 SetExternalDrawConstraints(
210 adjusted_transform, viewport, clip, !hardware_draw); 213 adjusted_transform, viewport, clip, !hardware_draw);
211 SetNeedsRedrawRect(gfx::Rect(viewport.size())); 214 SetNeedsRedrawRect(gfx::Rect(viewport.size()));
212 client_->BeginFrame(cc::BeginFrameArgs::CreateForSynchronousCompositor()); 215 client_->BeginFrame(cc::BeginFrameArgs::CreateForSynchronousCompositor());
213 216
214 // After software draws (which might move the viewport arbitrarily), restore 217 // After software draws (which might move the viewport arbitrarily), restore
215 // the previous hardware viewport to allow CC's tile manager to prioritize 218 // the previous hardware viewport to allow CC's tile manager to prioritize
216 // properly. 219 // properly.
217 if (hardware_draw) { 220 if (hardware_draw) {
218 cached_hw_transform_ = adjusted_transform; 221 cached_hw_transform_ = adjusted_transform;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { 258 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
256 return BrowserThread::CurrentlyOn(BrowserThread::UI); 259 return BrowserThread::CurrentlyOn(BrowserThread::UI);
257 } 260 }
258 261
259 SynchronousCompositorOutputSurfaceDelegate* 262 SynchronousCompositorOutputSurfaceDelegate*
260 SynchronousCompositorOutputSurface::GetDelegate() { 263 SynchronousCompositorOutputSurface::GetDelegate() {
261 return SynchronousCompositorImpl::FromRoutingID(routing_id_); 264 return SynchronousCompositorImpl::FromRoutingID(routing_id_);
262 } 265 }
263 266
264 } // namespace content 267 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698