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

Side by Side Diff: cc/resources/gpu_raster_worker_pool.cc

Issue 645853008: Standardize usage of virtual/override/final in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted Created 6 years, 2 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/resources/gpu_raster_worker_pool.h ('k') | cc/resources/image_layer_updater.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/resources/gpu_raster_worker_pool.h" 5 #include "cc/resources/gpu_raster_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
(...skipping 14 matching lines...) Expand all
25 class RasterBufferImpl : public RasterBuffer { 25 class RasterBufferImpl : public RasterBuffer {
26 public: 26 public:
27 RasterBufferImpl(ResourceProvider* resource_provider, 27 RasterBufferImpl(ResourceProvider* resource_provider,
28 const Resource* resource, 28 const Resource* resource,
29 SkMultiPictureDraw* multi_picture_draw) 29 SkMultiPictureDraw* multi_picture_draw)
30 : lock_(resource_provider, resource->id()), 30 : lock_(resource_provider, resource->id()),
31 resource_(resource), 31 resource_(resource),
32 multi_picture_draw_(multi_picture_draw) {} 32 multi_picture_draw_(multi_picture_draw) {}
33 33
34 // Overridden from RasterBuffer: 34 // Overridden from RasterBuffer:
35 virtual void Playback(const PicturePileImpl* picture_pile, 35 void Playback(const PicturePileImpl* picture_pile,
36 const gfx::Rect& rect, 36 const gfx::Rect& rect,
37 float scale, 37 float scale,
38 RenderingStatsInstrumentation* stats) override { 38 RenderingStatsInstrumentation* stats) override {
39 if (!lock_.sk_surface()) 39 if (!lock_.sk_surface())
40 return; 40 return;
41 41
42 SkPictureRecorder recorder; 42 SkPictureRecorder recorder;
43 gfx::Size size = resource_->size(); 43 gfx::Size size = resource_->size();
44 skia::RefPtr<SkCanvas> canvas = 44 skia::RefPtr<SkCanvas> canvas =
45 skia::SharePtr(recorder.beginRecording(size.width(), size.height())); 45 skia::SharePtr(recorder.beginRecording(size.width(), size.height()));
46 46
47 canvas->save(); 47 canvas->save();
48 picture_pile->RasterToBitmap(canvas.get(), rect, scale, stats); 48 picture_pile->RasterToBitmap(canvas.get(), rect, scale, stats);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 ScopedGpuRaster gpu_raster(context_provider_); 227 ScopedGpuRaster gpu_raster(context_provider_);
228 task_graph_runner_->RunUntilIdle(); 228 task_graph_runner_->RunUntilIdle();
229 229
230 // Draw each all of the pictures that were collected. This will also clear 230 // Draw each all of the pictures that were collected. This will also clear
231 // the pictures and canvases added to |multi_picture_draw_| 231 // the pictures and canvases added to |multi_picture_draw_|
232 multi_picture_draw_.draw(); 232 multi_picture_draw_.draw();
233 } 233 }
234 234
235 } // namespace cc 235 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/gpu_raster_worker_pool.h ('k') | cc/resources/image_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698