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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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 | « cc/trees/thread_proxy.cc ('k') | content/browser/aura/software_output_device_ozone.h » ('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 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 : public cc::SoftwareOutputDevice { 71 : public cc::SoftwareOutputDevice {
72 public: 72 public:
73 SoftwareDevice(SynchronousCompositorOutputSurface* surface) 73 SoftwareDevice(SynchronousCompositorOutputSurface* surface)
74 : surface_(surface), 74 : surface_(surface),
75 null_device_(SkBitmap::kARGB_8888_Config, 1, 1), 75 null_device_(SkBitmap::kARGB_8888_Config, 1, 1),
76 null_canvas_(&null_device_) { 76 null_canvas_(&null_device_) {
77 } 77 }
78 virtual void Resize(gfx::Size size) OVERRIDE { 78 virtual void Resize(gfx::Size size) OVERRIDE {
79 // Intentional no-op: canvas size is controlled by the embedder. 79 // Intentional no-op: canvas size is controlled by the embedder.
80 } 80 }
81 virtual SkCanvas* BeginPaint(gfx::Rect damage_rect) OVERRIDE { 81 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE {
82 if (!surface_->current_sw_canvas_) { 82 if (!surface_->current_sw_canvas_) {
83 NOTREACHED() << "BeginPaint with no canvas set"; 83 NOTREACHED() << "BeginPaint with no canvas set";
84 return &null_canvas_; 84 return &null_canvas_;
85 } 85 }
86 LOG_IF(WARNING, surface_->did_swap_buffer_) 86 LOG_IF(WARNING, surface_->did_swap_buffer_)
87 << "Mutliple calls to BeginPaint per frame"; 87 << "Mutliple calls to BeginPaint per frame";
88 return surface_->current_sw_canvas_; 88 return surface_->current_sw_canvas_;
89 } 89 }
90 virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE { 90 virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE {
91 } 91 }
92 virtual void CopyToBitmap(gfx::Rect rect, SkBitmap* output) OVERRIDE { 92 virtual void CopyToBitmap(const gfx::Rect& rect, SkBitmap* output) OVERRIDE {
93 NOTIMPLEMENTED(); 93 NOTIMPLEMENTED();
94 } 94 }
95 95
96 private: 96 private:
97 SynchronousCompositorOutputSurface* surface_; 97 SynchronousCompositorOutputSurface* surface_;
98 SkBitmapDevice null_device_; 98 SkBitmapDevice null_device_;
99 SkCanvas null_canvas_; 99 SkCanvas null_canvas_;
100 100
101 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice); 101 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice);
102 }; 102 };
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { 307 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
308 return BrowserThread::CurrentlyOn(BrowserThread::UI); 308 return BrowserThread::CurrentlyOn(BrowserThread::UI);
309 } 309 }
310 310
311 SynchronousCompositorOutputSurfaceDelegate* 311 SynchronousCompositorOutputSurfaceDelegate*
312 SynchronousCompositorOutputSurface::GetDelegate() { 312 SynchronousCompositorOutputSurface::GetDelegate() {
313 return SynchronousCompositorImpl::FromRoutingID(routing_id_); 313 return SynchronousCompositorImpl::FromRoutingID(routing_id_);
314 } 314 }
315 315
316 } // namespace content 316 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/thread_proxy.cc ('k') | content/browser/aura/software_output_device_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698