1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "gpu/command_buffer/service/gl_state_restorer_impl.h"
6
7#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
8
9namespace gpu {
10
11GLStateRestorerImpl::GLStateRestorerImpl(
12    base::WeakPtr<gles2::GLES2Decoder> decoder)
13    : decoder_(decoder) {
14}
15
16GLStateRestorerImpl::~GLStateRestorerImpl() {
17}
18
19bool GLStateRestorerImpl::IsInitialized() {
20  DCHECK(decoder_.get());
21  return decoder_->initialized();
22}
23
24void GLStateRestorerImpl::RestoreState() {
25  DCHECK(decoder_.get());
26  decoder_->RestoreState();
27}
28
29void GLStateRestorerImpl::RestoreAllTextureUnitBindings() {
30  DCHECK(decoder_.get());
31  decoder_->RestoreAllTextureUnitBindings();
32}
33
34void GLStateRestorerImpl::RestoreFramebufferBindings() {
35  DCHECK(decoder_.get());
36  decoder_->RestoreFramebufferBindings();
37}
38
39}  // namespace gpu
40