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

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

Issue 659563002: cc: Replace RasterBuffer::Acquire/ReleaseCanvas with Playback function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add temporary size variable 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 | « no previous file | cc/resources/gpu_raster_worker_pool.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 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/bitmap_raster_worker_pool.h" 5 #include "cc/resources/bitmap_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 "base/debug/trace_event_argument.h" 10 #include "base/debug/trace_event_argument.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "cc/debug/traced_value.h" 12 #include "cc/debug/traced_value.h"
13 #include "cc/resources/picture_pile_impl.h"
13 #include "cc/resources/raster_buffer.h" 14 #include "cc/resources/raster_buffer.h"
14 #include "cc/resources/resource.h" 15 #include "cc/resources/resource.h"
15 16
16 namespace cc { 17 namespace cc {
17 namespace { 18 namespace {
18 19
19 class RasterBufferImpl : public RasterBuffer { 20 class RasterBufferImpl : public RasterBuffer {
20 public: 21 public:
21 RasterBufferImpl(ResourceProvider* resource_provider, 22 RasterBufferImpl(ResourceProvider* resource_provider,
22 const Resource* resource) 23 const Resource* resource)
23 : lock_(resource_provider, resource->id()) {} 24 : lock_(resource_provider, resource->id()) {}
24 25
25 // Overridden from RasterBuffer: 26 // Overridden from RasterBuffer:
26 virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override { 27 virtual void Playback(const PicturePileImpl* picture_pile,
27 return skia::SharePtr(lock_.sk_canvas()); 28 const gfx::Rect& rect,
29 float scale,
30 RenderingStatsInstrumentation* stats) override {
31 picture_pile->RasterToBitmap(lock_.sk_canvas(), rect, scale, stats);
28 } 32 }
29 virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {}
30 33
31 private: 34 private:
32 ResourceProvider::ScopedWriteLockSoftware lock_; 35 ResourceProvider::ScopedWriteLockSoftware lock_;
33 36
34 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); 37 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
35 }; 38 };
36 39
37 } // namespace 40 } // namespace
38 41
39 // static 42 // static
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 new base::debug::TracedValue(); 195 new base::debug::TracedValue();
193 196
194 state->BeginArray("tasks_pending"); 197 state->BeginArray("tasks_pending");
195 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) 198 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set)
196 state->AppendBoolean(raster_pending_[task_set]); 199 state->AppendBoolean(raster_pending_[task_set]);
197 state->EndArray(); 200 state->EndArray();
198 return state; 201 return state;
199 } 202 }
200 203
201 } // namespace cc 204 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/gpu_raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698