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

Side by Side Diff: cc/raster/gpu_raster_buffer_provider.cc

Issue 2149533003: Remove use of unsupported Skia flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | skia/config/SkUserConfig.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/raster/gpu_raster_buffer_provider.h" 5 #include "cc/raster/gpu_raster_buffer_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 static_cast<float>(playback_rect.size().GetArea()) / full_rect_size; 52 static_cast<float>(playback_rect.size().GetArea()) / full_rect_size;
53 float fraction_saved = 1.0f - fraction_partial_rastered; 53 float fraction_saved = 1.0f - fraction_partial_rastered;
54 UMA_HISTOGRAM_PERCENTAGE( 54 UMA_HISTOGRAM_PERCENTAGE(
55 base::StringPrintf("Renderer4.%s.PartialRasterPercentageSaved.Gpu", 55 base::StringPrintf("Renderer4.%s.PartialRasterPercentageSaved.Gpu",
56 client_name), 56 client_name),
57 100.0f * fraction_saved); 57 100.0f * fraction_saved);
58 } 58 }
59 59
60 // Play back raster_source into temp SkPicture. 60 // Play back raster_source into temp SkPicture.
61 SkPictureRecorder recorder; 61 SkPictureRecorder recorder;
62 const int flags = SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag; 62 sk_sp<SkCanvas> canvas = sk_ref_sp(
63 sk_sp<SkCanvas> canvas = sk_ref_sp(recorder.beginRecording( 63 recorder.beginRecording(resource_size.width(), resource_size.height()));
64 resource_size.width(), resource_size.height(), NULL, flags));
65 canvas->save(); 64 canvas->save();
66 raster_source->PlaybackToCanvas(canvas.get(), raster_full_rect, playback_rect, 65 raster_source->PlaybackToCanvas(canvas.get(), raster_full_rect, playback_rect,
67 scale, playback_settings); 66 scale, playback_settings);
68 canvas->restore(); 67 canvas->restore();
69 return recorder.finishRecordingAsPicture(); 68 return recorder.finishRecordingAsPicture();
70 } 69 }
71 70
72 static void RasterizePicture(SkPicture* picture, 71 static void RasterizePicture(SkPicture* picture,
73 ContextProvider* context_provider, 72 ContextProvider* context_provider,
74 ResourceProvider::ScopedWriteLockGL* resource_lock, 73 ResourceProvider::ScopedWriteLockGL* resource_lock,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 gl->OrderingBarrierCHROMIUM(); 243 gl->OrderingBarrierCHROMIUM();
245 244
246 // Generate sync token after the barrier for cross context synchronization. 245 // Generate sync token after the barrier for cross context synchronization.
247 gpu::SyncToken resource_sync_token; 246 gpu::SyncToken resource_sync_token;
248 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); 247 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData());
249 resource_lock->set_sync_token(resource_sync_token); 248 resource_lock->set_sync_token(resource_sync_token);
250 resource_lock->set_synchronized(!async_worker_context_enabled_); 249 resource_lock->set_synchronized(!async_worker_context_enabled_);
251 } 250 }
252 251
253 } // namespace cc 252 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | skia/config/SkUserConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698