| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 } | 859 } |
| 860 | 860 |
| 861 bool Canvas2DLayerBridge::RestoreSurface() { | 861 bool Canvas2DLayerBridge::RestoreSurface() { |
| 862 DCHECK(!destruction_in_progress_); | 862 DCHECK(!destruction_in_progress_); |
| 863 if (destruction_in_progress_ || !IsAccelerated()) | 863 if (destruction_in_progress_ || !IsAccelerated()) |
| 864 return false; | 864 return false; |
| 865 DCHECK(!surface_); | 865 DCHECK(!surface_); |
| 866 | 866 |
| 867 gpu::gles2::GLES2Interface* shared_gl = nullptr; | 867 gpu::gles2::GLES2Interface* shared_gl = nullptr; |
| 868 layer_->ClearTexture(); | 868 layer_->ClearTexture(); |
| 869 context_provider_ = WTF::WrapUnique( | 869 context_provider_ = |
| 870 Platform::Current()->CreateSharedOffscreenGraphicsContext3DProvider()); | 870 Platform::Current()->CreateSharedOffscreenGraphicsContext3DProvider(); |
| 871 if (context_provider_) | 871 if (context_provider_) |
| 872 shared_gl = context_provider_->ContextGL(); | 872 shared_gl = context_provider_->ContextGL(); |
| 873 | 873 |
| 874 if (shared_gl && shared_gl->GetGraphicsResetStatusKHR() == GL_NO_ERROR) { | 874 if (shared_gl && shared_gl->GetGraphicsResetStatusKHR() == GL_NO_ERROR) { |
| 875 GrContext* gr_ctx = context_provider_->GetGrContext(); | 875 GrContext* gr_ctx = context_provider_->GetGrContext(); |
| 876 bool surface_is_accelerated; | 876 bool surface_is_accelerated; |
| 877 sk_sp<SkSurface> surface(CreateSkSurface(gr_ctx, size_, msaa_sample_count_, | 877 sk_sp<SkSurface> surface(CreateSkSurface(gr_ctx, size_, msaa_sample_count_, |
| 878 opacity_mode_, color_params_, | 878 opacity_mode_, color_params_, |
| 879 &surface_is_accelerated)); | 879 &surface_is_accelerated)); |
| 880 if (!surface_) | 880 if (!surface_) |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 default; | 1128 default; |
| 1129 | 1129 |
| 1130 void Canvas2DLayerBridge::Logger::ReportHibernationEvent( | 1130 void Canvas2DLayerBridge::Logger::ReportHibernationEvent( |
| 1131 HibernationEvent event) { | 1131 HibernationEvent event) { |
| 1132 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernation_histogram, | 1132 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernation_histogram, |
| 1133 ("Canvas.HibernationEvents", kHibernationEventCount)); | 1133 ("Canvas.HibernationEvents", kHibernationEventCount)); |
| 1134 hibernation_histogram.Count(event); | 1134 hibernation_histogram.Count(event); |
| 1135 } | 1135 } |
| 1136 | 1136 |
| 1137 } // namespace blink | 1137 } // namespace blink |
| OLD | NEW |