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

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

Issue 797793005: Add rTree factory to beginRecording call in RasterBufferImpl ctor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the beginRecording call has moved to gpu_rasterizer.cc Created 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_rasterizer.h" 5 #include "cc/resources/gpu_rasterizer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 new ResourceProvider::ScopedWriteLockGr(resource_provider_, 121 new ResourceProvider::ScopedWriteLockGr(resource_provider_,
122 resource->id())); 122 resource->id()));
123 SkSurface* sk_surface = lock->GetSkSurface( 123 SkSurface* sk_surface = lock->GetSkSurface(
124 use_distance_field_text, tile->raster_source()->CanUseLCDText()); 124 use_distance_field_text, tile->raster_source()->CanUseLCDText());
125 125
126 locks->push_back(lock.Pass()); 126 locks->push_back(lock.Pass());
127 127
128 if (!sk_surface) 128 if (!sk_surface)
129 return; 129 return;
130 130
131 SkRTreeFactory factory;
131 SkPictureRecorder recorder; 132 SkPictureRecorder recorder;
132 gfx::Size size = resource->size(); 133 gfx::Size size = resource->size();
133 const int flags = SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag; 134 const int flags = SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag;
134 skia::RefPtr<SkCanvas> canvas = skia::SharePtr( 135 skia::RefPtr<SkCanvas> canvas = skia::SharePtr(
135 recorder.beginRecording(size.width(), size.height(), NULL, flags)); 136 recorder.beginRecording(size.width(), size.height(), &factory, flags));
136 137
137 canvas->save(); 138 canvas->save();
138 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(), 139 tile->raster_source()->PlaybackToCanvas(canvas.get(), tile->content_rect(),
139 tile->contents_scale()); 140 tile->contents_scale());
140 canvas->restore(); 141 canvas->restore();
141 142
142 // Add the canvas and recorded picture to |multi_picture_draw_|. 143 // Add the canvas and recorded picture to |multi_picture_draw_|.
143 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); 144 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
144 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get()); 145 multi_picture_draw_.add(sk_surface->getCanvas(), picture.get());
145 } 146 }
146 147
147 } // namespace cc 148 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698